diff --git a/drupal/modules/epal/src/Controller/ApplicationSubmit.php b/drupal/modules/epal/src/Controller/ApplicationSubmit.php index e8e1264de856936709caa28ef12f737d330c11db..3243e34825c1a34b8f70bbfdea0f146947cc15c2 100644 --- a/drupal/modules/epal/src/Controller/ApplicationSubmit.php +++ b/drupal/modules/epal/src/Controller/ApplicationSubmit.php @@ -71,11 +71,11 @@ class ApplicationSubmit extends ControllerBase { 'epaluser_id' => $epalUser->id(), 'name' => $applicationForm[0][name], 'studentsurname' => $applicationForm[0][studentsurname], - //'birthdate' => $applicationForm[0][birthdate], - //'fatherfirstname' => $applicationForm[0][fatherfirstname], - //'fathersurname' => $applicationForm[0][fathersurname], - //'motherfirstname' => $applicationForm[0][motherfirstname], - //'mothersurname' => $applicationForm[0][mothersurname], + 'birthdate' => $applicationForm[0][studentbirthdate], + 'fatherfirstname' => $applicationForm[0][fatherfirstname], + 'fathersurname' => $applicationForm[0][fathersurname], + 'motherfirstname' => $applicationForm[0][motherfirstname], + 'mothersurname' => $applicationForm[0][mothersurname], 'studentamka' => $applicationForm[0][studentamka], 'regionaddress' => $applicationForm[0][regionaddress], 'regionarea' => $applicationForm[0][regionarea], @@ -85,6 +85,7 @@ class ApplicationSubmit extends ControllerBase { 'currentclass' => $applicationForm[0][currentclass], //'currentepal' => $applicationForm[0][currentepal], //'currentsector' => $applicationForm[0][currentsector], + 'points' => $applicationForm[0][points], 'relationtostudent' => $applicationForm[0][relationtostudent], 'telnum' => $applicationForm[0][telnum] ); diff --git a/drupal/modules/epal/src/Controller/Distribution.php b/drupal/modules/epal/src/Controller/Distribution.php index 077a60669412277797f893b243307675482c2f0d..5cc30c068a1bdc1a48fed278c579b657ed11ff33 100644 --- a/drupal/modules/epal/src/Controller/Distribution.php +++ b/drupal/modules/epal/src/Controller/Distribution.php @@ -13,11 +13,17 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Drupal\Core\Controller\ControllerBase; use Symfony\Component\HttpFoundation\RedirectResponse; +use Drupal\Core\Database\Database; use Drupal\Core\Database\Connection; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Drupal\Core\Logger\LoggerChannelFactoryInterface; +//use Drupal\Core\Datetime\DrupalDateTime; +use Drupal\Core\TypedData\Plugin\DataType\TimeStamp; + +use Drupal\Core\Language\LanguageManagerInterface; + class Distribution extends ControllerBase { @@ -26,19 +32,28 @@ class Distribution extends ControllerBase { protected $entityTypeManager; protected $logger; protected $connection; + protected $language; + protected $currentuser; protected $pendingStudents = array(); protected $choice_id = 1; + protected $globalCounterId = 1; public function __construct( EntityTypeManagerInterface $entityTypeManager, QueryFactory $entity_query, Connection $connection, + LoggerChannelFactoryInterface $loggerChannel) { $this->entityTypeManager = $entityTypeManager; $this->entity_query = $entity_query; + $connection = Database::getConnection(); $this->connection = $connection; + $language = \Drupal::languageManager()->getCurrentLanguage()->getId(); + $this->language = $language; + $currentuser = \Drupal::currentUser()->id(); + $this->currentuser = $currentuser; $this->logger = $loggerChannel->get('epal'); } @@ -55,6 +70,9 @@ class Distribution extends ControllerBase { public function createDistribution(Request $request) { + $numDistributions = 3; + $sizeOfBlock = 100000; + /* if (!$request->isMethod('POST')) { return $this->respondWithStatus([ @@ -63,101 +81,113 @@ class Distribution extends ControllerBase { } */ - $limitUp_class = $this->retrieveCapacityLimitUp("Α"); - //print_r("
ΑΝΩΤΑΤΟ ΟΡΙΟ ΜΑΘΗΤΩΝ: " . $limitUp_class); - //$limitUp_classSector = $this->retrieveCapacityLimitUp("Β"); - //$limitUp_classCourse = $this->retrieveCapacityLimitUp("Γ"); + //clearDistributionResults(); - $sizeOfBlock = 200; - $numDistributions = 3; + $transaction = $this->connection->startTransaction(); + + try { - //$choice_id = 1; - while ($this->choice_id <= $numDistributions) { + //initialize/empty epal_student_class if there are already data in it! + $this->connection->delete('epal_student_class')->execute(); - print_r("
ΠΕΡΑΣΜΑ: " . $this->choice_id); + $limitUp_class = $this->retrieveCapacityLimitUp("Α"); + print_r("
ΑΝΩΤΑΤΟ ΟΡΙΟ ΜΑΘΗΤΩΝ: " . $limitUp_class); - $epalStudents_storage = $this->entityTypeManager->getStorage('epal_student'); + while ($this->choice_id <= $numDistributions) { + + print_r("
ΠΕΡΑΣΜΑ: " . $this->choice_id); //υπολογισμός πλήθους non-finalized αιτήσεων για να καθοριστεί ο αριθμός των fetches που θα κάνουμε με συγκεκριμένο sizeOfBlock if ($this->choice_id === 1) { - $idsStud = $epalStudents_storage->getQuery() - ->execute(); - $numData = sizeof($idsStud); - print_r("
numData: " . $numData); - $epalStudents_storage->resetCache($idsStud); + $sCon = $this->connection->select('epal_student', 'eStudent') + ->fields('eStudent', array('id')); + $numData = $sCon->countQuery()->execute()->fetchField(); + print_r("
numData: " . $numData); } $j = 1; $num = 1; if ($this->choice_id === 1) { while ($num <= $numData) { + print_r("
FETCH: " . $j); - $idsStud = $epalStudents_storage->getQuery() - ->condition('id', 1+ $sizeOfBlock*($j-1), '>=') - ->condition('id', $j*$sizeOfBlock, '<=') - ->execute(); - $epalStudents = $epalStudents_storage->loadMultiple($idsStud); + $sCon = $this->connection->select('epal_student', 'eStudent') + ->fields('eStudent', array('id', 'name', 'currentclass', 'currentepal', 'points')) + ->condition('eStudent.id', 1+ $sizeOfBlock*($j-1), '>=') + ->condition('eStudent.id', $j*$sizeOfBlock, '<='); + $epalStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ); + $this->locateStudent($this->choice_id, $epalStudents); - $num = $num + sizeof($idsStud); + $num = $num + sizeof($epalStudents); $j = $j + 1; - - $epalStudents_storage->resetCache($idsStud); } } else { - $idsStud = $epalStudents_storage->getQuery() - ->condition('id', $this->pendingStudents,"IN") - ->execute(); - $epalStudents = $epalStudents_storage->loadMultiple($idsStud); - $this->locateStudent($this->choice_id, $epalStudents); + + if (sizeof($this->pendingStudents) != 0) { + $sCon = $this->connection->select('epal_student', 'eStudent') + ->fields('eStudent', array('id', 'name', 'currentclass', 'currentepal', 'points')) + ->condition('eStudent.id', $this->pendingStudents, 'IN'); + $epalStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ); + + //foreach ($epalStudents as $x) + // print_r("
TEST:" . $x->id . " "); + + $this->locateStudent($this->choice_id, $epalStudents); + } + else { //αν δεν υπάρχουν εκκρεμότητες, μην συνεχίζεις με άλλο πέρασμα + break; + } } //Για κάθε σχολείο βρες τα τμήματα //Για κάθε τμήμα βρες αν χωράνε και διευθέτησε (checkCapacityAndArrange) //checkCapacityAndArrange (school_id, class_id, sectorORcourse_id, limitUp, schoolCapacity) - - - - $eepalSchools_storage = $this->entityTypeManager->getStorage('eepal_school'); - $idsSch = $eepalSchools_storage->getQuery() //προσαρμοσμένο για τα demo data --> να αλλάξει - ->condition('id', '246', '<=') - ->condition('id', '147', '>=') - ->execute(); - $eepalSchools = $eepalSchools_storage->loadMultiple($idsSch); - $eepalSchools_storage->resetCache(); + $sCon = $this->connection->select('eepal_school_field_data', 'eSchool') + ->fields('eSchool', array('id', 'capacity_class_a')); + //->condition('eSchool.id', 151, '>=') + //->condition('eSchool.id', 153, '<='); //προσαρμοσμένο για τα demo data --> να αλλάξει + $eepalSchools = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ); foreach ($eepalSchools as $eepalSchool) { - $this->checkCapacityAndArrange($eepalSchool->id->value, "1", "-1", $limitUp_class, $eepalSchool->capacity_class_a->value); + $this->checkCapacityAndArrange($eepalSchool->id, "1", "-1", $limitUp_class, $eepalSchool->capacity_class_a); - - $eepalSectorsInEpal_storage = $this->entityTypeManager->getStorage('eepal_sectors_in_epal'); - $eepalSectorsInEpal = $eepalSectorsInEpal_storage->loadByProperties(array('epal_id' => $eepalSchool->id->value) ); + $sCon = $this->connection->select('eepal_sectors_in_epal_field_data', 'eSchool') + ->fields('eSchool', array('epal_id', 'sector_id', 'capacity_class_sector')) + ->condition('eSchool.epal_id', $eepalSchool->id, '='); + $eepalSectorsInEpal = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ); foreach ($eepalSectorsInEpal as $eepalSecInEp) { - //print_r("
Sectors " . $eepalSecInEp->sector_id->getString()); - $this->checkCapacityAndArrange($eepalSchool->id->value, "2", $eepalSecInEp->sector_id->getString(), $limitUp_class, $eepalSecInEp->capacity_class_sector->value); + $this->checkCapacityAndArrange($eepalSchool->id, "2", $eepalSecInEp->sector_id, $limitUp_class, $eepalSecInEp->capacity_class_sector); } - $eepalSpecialtiesInEpal_storage = $this->entityTypeManager->getStorage('eepal_specialties_in_epal'); - $eepalSpecialtiesInEpal = $eepalSpecialtiesInEpal_storage->loadByProperties(array('epal_id' => $eepalSchool->id->value) ); + $sCon = $this->connection->select('eepal_specialties_in_epal_field_data', 'eSchool') + ->fields('eSchool', array('epal_id', 'specialty_id', 'capacity_class_specialty')) + ->condition('eSchool.epal_id', $eepalSchool->id, '='); + $eepalSpecialtiesInEpal = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ); foreach ($eepalSpecialtiesInEpal as $eepalSpecialInEp) { - //print_r("
Specialties " . $eepalSpecialInEp->specialty_id->getString()); - $this->checkCapacityAndArrange($eepalSchool->id->value, "3", $eepalSpecialInEp->specialty_id->getString(), $limitUp_class, $eepalSpecialInEp->capacity_class_specialty->value); + $this->checkCapacityAndArrange($eepalSchool->id, "3", $eepalSpecialInEp->specialty_id, $limitUp_class, $eepalSpecialInEp->capacity_class_specialty); } - $eepalSectorsInEpal_storage->resetCache(); - $eepalSpecialtiesInEpal_storage->resetCache(); - - } //end for each school/department $this->choice_id++; } //end while + } //end try + + catch (\Exception $e) { + $this->logger->warning($e->getMessage()); + $transaction->rollback(); return $this->respondWithStatus([ + "message" => t("An unexpected problem occured") + ], Response::HTTP_INTERNAL_SERVER_ERROR); + } + + return $this->respondWithStatus([ "message" => t("Distribution has made successfully") ], Response::HTTP_OK); @@ -169,56 +199,76 @@ class Distribution extends ControllerBase { $epal_dist_id = -1; $specialization_id = -1; - try { + $transaction = $this->connection->startTransaction(); - $epalSchoolsChosen_storage = $this->entityTypeManager->getStorage('epal_student_epal_chosen'); - $epalSectorChosen_storage = $this->entityTypeManager->getStorage('epal_student_sector_field'); - $epalCourseChosen_storage = $this->entityTypeManager->getStorage('epal_student_course_field'); - $epalStudentClass_storage = $this->entityTypeManager->getStorage('epal_student_class'); + try { foreach ($epalStudents as $epalStudent) { print_r("
ΚΑΤΑΝΟΜΗ ΜΑΘΗΤΩΝ ΝΟ: " . $choice_id); - $epalSchoolsChosen = $epalSchoolsChosen_storage->loadByProperties(array('student_id' => $epalStudent->id->value , 'choice_no' => $choice_id) ); + print_r("
ΜΑΘΗΤΗΣ: " . $epalStudent->id); + + $clCon = $this->connection->select('epal_student_epal_chosen', 'epals') + ->fields('epals', array('student_id', 'epal_id', 'choice_no')) + ->condition('epals.student_id', $epalStudent->id , '=') + ->condition('epals.choice_no', $choice_id , '='); + $epalSchoolsChosen = $clCon->execute()->fetchAll(\PDO::FETCH_OBJ); if (sizeof($epalSchoolsChosen) !== 0) { $epalSchoolChos = reset($epalSchoolsChosen); - print_r(" SCHOOL_ID:" . $epalSchoolChos->epal_id->getString() . " STUDENT_ID " . $epalStudent->id->getString()); - $epal_dist_id = $epalSchoolChos->epal_id->getString(); - - if ($epalStudent->currentclass->value === "2") { - $epalSectorChosen = $epalSectorChosen_storage->loadByProperties(array('student_id' => $epalStudent->id->value)); + print_r(" SCHOOL_ID:" . $epalSchoolChos->epal_id . " STUDENT_ID " . $epalStudent->id); + $epal_dist_id = $epalSchoolChos->epal_id; + + if ($epalStudent->currentclass === "2") { + $clCon = $this->connection->select('epal_student_sector_field', 'sectors') + ->fields('sectors', array('student_id', 'sectorfield_id')) + ->condition('sectors.student_id', $epalStudent->id , '='); + $epalSectorChosen = $clCon->execute()->fetchAll(\PDO::FETCH_OBJ); $epalSecChos = reset($epalSectorChosen); - //print_r(" SECTOR_ID:" . $epalSecChos->sectorfield_id->getString() . " "); } - elseif ($epalStudent->currentclass->value === "3") { - $epalCourseChosen = $epalCourseChosen_storage->loadByProperties(array('student_id' => $epalStudent->id->value)); + elseif ($epalStudent->currentclass === "3") { + $clCon = $this->connection->select('epal_student_course_field', 'courses') + ->fields('courses', array('student_id', 'coursefield_id')) + ->condition('courses.student_id', $epalStudent->id , '='); + $epalCourseChosen = $clCon->execute()->fetchAll(\PDO::FETCH_OBJ); $epalCourChos = reset($epalCourseChosen); - //print_r(" COURSE_ID:" . $epalCourChos->coursefield_id->getString() . " "); } - if ($epalStudent->currentclass->value === "2") - $specialization_id = $epalSecChos->sectorfield_id->getString(); - elseif ($epalStudent->currentclass->value === "3") - $specialization_id = $epalCourChos->coursefield_id->getString(); + if ($epalStudent->currentclass === "2") + $specialization_id = $epalSecChos->sectorfield_id; + elseif ($epalStudent->currentclass === "3") + $specialization_id = $epalCourChos->coursefield_id; else $specialization_id = -1; - $studentClass = array('student_id'=> $epalStudent->id->value, 'epal_id'=> $epal_dist_id, 'currentclass' => $epalStudent->currentclass->value, - 'currentepal' => $epalStudent->currentepal->getString(), 'specialization_id' => $specialization_id, - 'distribution_id' => $choice_id, 'points' => $epalStudent->points->value); - $studentClass_object = $epalStudentClass_storage->create($studentClass); - $epalStudentClass_storage->save($studentClass_object); + + //$currentTime = \Drupal\Core\TypedData\Plugin\DataType\TimeStamp::getDateTime(); + $timestamp = strtotime(date("Y-m-d")); + $this->connection->insert('epal_student_class')->fields( + array('id' => $this->globalCounterId++, + 'uuid' => \Drupal::service('uuid')->generate(), + 'langcode' => $this->language, + 'user_id' => $this->currentuser, + 'student_id'=> $epalStudent->id, + 'epal_id'=> $epal_dist_id, + 'currentclass' => $epalStudent->currentclass, + 'currentepal' => $epalStudent->currentepal, + 'specialization_id' => $specialization_id, + 'points' => $epalStudent->points, + 'distribution_id' => $choice_id, + 'status' => 1, + 'created' => $timestamp, + 'changed' => $timestamp,) + )->execute(); } //end if } //foreach - $epalSchoolsChosen_storage->resetCache(); - $epalStudentClass_storage->resetCache(); } catch (\Exception $e) { $this->logger->warning($e->getMessage()); + $transaction->rollback(); return $this->respondWithStatus([ "message" => t("An unexpected problem occured during locateStudent Method of Distribution") ], Response::HTTP_INTERNAL_SERVER_ERROR); @@ -232,63 +282,104 @@ class Distribution extends ControllerBase { public function retrieveCapacityLimitUp($className) { - $epalClassLimits_storage = $this->entityTypeManager->getStorage('epal_class_limits'); - $epalClassLimits = $epalClassLimits_storage->loadByProperties(array('name' => $className)); - $epalClassLimit = reset($epalClassLimits); - $limit_up = $epalClassLimit->limit_up->value; - $epalClassLimits_storage->resetCache(); - return $limit_up; + $transaction = $this->connection->startTransaction(); + + try { + $clCon = $this->connection->select('epal_class_limits', 'classLimits') + ->fields('classLimits', array('limit_up')) + ->condition('classLimits.name', $className, '='); + $results = $clCon->execute()->fetchAll(\PDO::FETCH_OBJ); + $row = reset($results); + } + catch (\Exception $e) { + $this->logger->warning($e->getMessage()); + $transaction->rollback(); + return $this->respondWithStatus([ + "message" => t("An unexpected problem occured during retrieveCapacityLimitUp Method of Distribution") + ], Response::HTTP_INTERNAL_SERVER_ERROR); + } + + return $row->limit_up; } public function checkCapacityAndArrange($epalId, $classId, $secCourId, $limitup, $capacity) { - $epalStudentClass_storage = $this->entityTypeManager->getStorage('epal_student_class'); - $epalStudentClass = $epalStudentClass_storage->loadByProperties(array('epal_id' => $epalId, 'currentclass' => $classId, 'specialization_id' => $secCourId )); - print_r("
ΣΧΟΛΕΙΟ: " . $epalId . " ΤΑΞΗ: " . $classId . " ΤΟΜΕΑΣ/ΕΙΔΙΚΟΤΗΤΑ: " . $secCourId . " ΧΩΡΗΤΙΚΟΤΗΤΑ: " . sizeof($epalStudentClass)); - - $limit = $limitup * $capacity; - if (sizeof($epalStudentClass) > $limit) { - print_r("
ΥΠΕΡΧΕΙΛΙΣΗ!"); - foreach ($epalStudentClass as $epalStudCl) { - //Υπολογισμός μορίων του μαθητή και (πιθανή) αποθήκευσή τους - //$points = $this->calculatePoints(); - //$epalStudCl->set('points', $points, true)->save(); + $transaction = $this->connection->startTransaction(); + + try { + + $clCon = $this->connection->select('epal_student_class', 'studentClass') + ->fields('studentClass', array('epal_id', 'student_id', 'points', 'currentepal', 'currentclass', 'specialization_id')) + ->condition('studentClass.epal_id', $epalId, '=') + ->condition('studentClass.currentclass', $classId, '=') + ->condition('studentClass.specialization_id', $secCourId, '='); + $epalStudentClass = $clCon->execute()->fetchAll(\PDO::FETCH_OBJ); + + print_r("
ΣΧΟΛΕΙΟ: " . $epalId . " ΤΑΞΗ: " . $classId . " ΤΟΜΕΑΣ/ΕΙΔΙΚΟΤΗΤΑ: " . $secCourId . " ΧΩΡΗΤΙΚΟΤΗΤΑ: " . sizeof($epalStudentClass)); + + //ΕΠΙΠΛΕΟΝ ΕΠΙΠΕΔΟ ΑΣΦΑΛΕΙΑΣ: αν δεν υπάρχει ο συγκεκριμένος τομέας/ειδικότητα στο σχολείο + //ο μαθητής που τοποθετήθηκε με την locateStudent να διαγραφεί + //Σημείωση: κανονικά κάτι τέτοιο δεν μπορεί να συμβεί από το front-end (δηλ. μαθητής να δηλώσει τομέα/ειδικότητα που δεν προσφέρεται..) + //ΑΝ ΜΠΕΙ ΠΡΕΠΕΙ ΝΑ ΕΝΣΩΜΑΤΩΘΕΙ ΣΤΗΝ LOCATESTUDENT.. + /* + if (sizeof($epalStudentClass) === 0) { + //print_r("
ΜΠΗΚΑ! "); + foreach ($epalStudentClass as $epalStudCl) { + //print_r("
ΜΠΗΚΑ! ΜΑΘΗΤΗΣ: " . $epalStudCl->student_id); + $query = $this->connection->delete('epal_student_class') + ->condition('student_id', $epalStudCl->student_id) + ->execute(); + } + } + */ + //ΤΕΛΟΣ + + $limit = $limitup * $capacity; + if (sizeof($epalStudentClass) > $limit) { + print_r("
ΥΠΕΡΧΕΙΛΙΣΗ!"); + foreach ($epalStudentClass as $epalStudCl) { + //Υπολογισμός μορίων του μαθητή και (πιθανή) αποθήκευσή τους + //ΣΗΜΕΙΩΣΗ: Ο υπoλογισμός γίνεται στο front-end + + //$points = $this->calculatePoints(); + /* + $query = $this->connection->update('epal_student'); + $query->fields([ + 'points' =>$points, + ]); + $query->condition('id',$epalStudCl->student_id); + $query->execute(); + */ + + } + $this->makeSelectionOfStudents($epalStudentClass,$limit); } - $this->makeSelectionOfStudents($epalStudentClass,$limit); - } - else { //αφαίρεσε όσους μαθητές βρίσκονται στον πίνακα εκκρεμοτήτων - foreach ($epalStudentClass as $epalStudCl) { - if ($this->choice_id !== 1) - ////διέγραψε τον μαθητή από τον πίνακα εκκρεμοτήτων (αν βρίσκεται εκεί) - $this->removeFromPendingStudents($epalStudCl->student_id->getString()); + else { //αφαίρεσε όσους μαθητές βρίσκονται στον πίνακα εκκρεμοτήτων + foreach ($epalStudentClass as $epalStudCl) { + if ($this->choice_id !== 1) + ////διέγραψε τον μαθητή από τον πίνακα εκκρεμοτήτων (αν βρίσκεται εκεί) + $this->removeFromPendingStudents($epalStudCl->student_id); + } } - } - $epalStudentClass_storage->resetCache(); + } //end try + catch (\Exception $e) { + $this->logger->warning($e->getMessage()); + $transaction->rollback(); return $this->respondWithStatus([ + "message" => t("An unexpected problem occured during checkCapacityAndArrange Method of Distribution") + ], Response::HTTP_INTERNAL_SERVER_ERROR); + } + + return $this->respondWithStatus([ "message" => t("checkCapacityAndArrange Method of Distribution has made successfully") ], Response::HTTP_OK); } - public function setFinalized($student, $status ) { - //δεν χρησιμοποιείται - /* - - $epalStudents_storage = $this->entityTypeManager->getStorage('epal_student'); - //foreach ($studentClass as $studCl) { - $epalStudents = $epalStudents_storage->loadByProperties(array('id' => $student->student_id->getString()) ); - $epalStudent = reset($epalStudents); - print_r("
SET FINALIZED TO:" .$status . " STUDENT_ID:" . $student->student_id->getString() ); - $epalStudent->set('finalized', $status, true)->save(); - - */ - - } - public function removeFromPendingStudents($val) { if(($key = array_search($val, $this->pendingStudents)) !== false) { unset($this->pendingStudents[$key]); @@ -303,18 +394,18 @@ class Distribution extends ControllerBase { //αυτοδίκαια έχουν προτεραιότητα όσοι ήδη φοιτούσαν στο σχολείο foreach($students as $student) { - $student->student_id->getString(); - print_r("
STUDENT_ID:" . $student->student_id->getString()); + $student->student_id; + print_r("
STUDENT_ID:" . $student->student_id); } //εύρεση αριθμού μαθητών που ήδη φοιτούσαν στο σχολείο $cnt = 0; foreach($students as $student) { - if ($student->currentepal->getString() === $student->epal_id->getString()) { + if ($student->currentepal === $student->epal_id) { $cnt++; if ($this->choice_id !== 1) ////διέγραψε τον μαθητή από τον πίνακα εκκρεμοτήτων (αν βρίσκεται εκεί) - $this->removeFromPendingStudents($student->student_id->getString()); + $this->removeFromPendingStudents($student->student_id); } } print_r("
#ΕΓΓΡΑΦΩΝ ΠΟΥ ΟΙ ΜΑΘΗΤΕΣ ΦΟΙΤΟΥΣΑΝ ΗΔΗ:" . $cnt); @@ -325,29 +416,42 @@ class Distribution extends ControllerBase { $points_arr = []; foreach($students as $student) { - if ($student->currentepal->getString() !== $student->epal_id->getString()) - $points_arr[] = $student->points->value; + if ($student->currentepal !== $student->epal_id) + $points_arr[] = $student->points; } - //for ($i=0; $i < sizeof($points_arr); $i++) - // print_r("
MORIA:" . $points_arr[$i]); + rsort($points_arr); for ($i=0; $i < sizeof($points_arr); $i++) print_r("
ΜΟΡΙΑ ΜΕΤΑ ΤΗΝ ΤΑΞΙΝΟΜΙΣΗ: " . $points_arr[$i]); print_r("
ΟΡΙΟ ΜΟΡΙΩΝ: " . $points_arr[$newlimit-1]); + $transaction = $this->connection->startTransaction(); + foreach($students as $student) { - if ($student->currentepal->getString() !== $student->epal_id->getString()) { - if ($student->points->value < $points_arr[$newlimit-1]) { - print_r("
ΣΕ ΕΚΚΡΕΜΟΤΗΤΑ - ΔΙΑΓΡΑΦΗ: " . $student->student_id->getString()); + if ($student->currentepal !== $student->epal_id) { + if ($student->points < $points_arr[$newlimit-1]) { + print_r("
ΣΕ ΕΚΚΡΕΜΟΤΗΤΑ - ΔΙΑΓΡΑΦΗ: " . $student->student_id); //βάλε τον μαθητή στον πίνακα εκκρεμοτήτων και διέγραψέ τον από τον προσωρινό πίνακα αποτελεσμάτων - array_push($this->pendingStudents, $student->student_id->getString() ); - $student->delete(); + array_push($this->pendingStudents, $student->student_id); + try { + $this->connection->delete('epal_student_class') + ->condition('student_id', $student->student_id) + ->execute(); + } + catch (\Exception $e) { + $this->logger->warning($e->getMessage()); + $transaction->rollback(); + return $this->respondWithStatus([ + "message" => t("An unexpected problem occured during DELETE proccess in makeSelectionOfStudents Method of Distribution") + ], Response::HTTP_INTERNAL_SERVER_ERROR); + } + } else { if ($this->choice_id !== 1) //διέγραψε τον μαθητή από τον πίνακα εκκρεμοτήτων (αν βρίσκεται εκεί) - $this->removeFromPendingStudents($student->student_id->getString()); + $this->removeFromPendingStudents($student->student_id); } } } diff --git a/drupal/modules/epaldeploysystem/config/install/views.view.criterialist.yml b/drupal/modules/epaldeploysystem/config/install/views.view.criterialist.yml index 5856019eb52f710ba9b17c095bfb4c23c569508d..c6fcfa15bdaeff9a13298f89856b824f375ac112 100644 --- a/drupal/modules/epaldeploysystem/config/install/views.view.criterialist.yml +++ b/drupal/modules/epaldeploysystem/config/install/views.view.criterialist.yml @@ -12,6 +12,8 @@ dependencies: - rest - serialization - user +_core: + default_config_hash: 2NbNzaqbe_smf6WW5GA6xdNaOyLrqo5IfrwynZngc0k id: criterialist label: criteriaList module: views @@ -213,6 +215,71 @@ display: multi_type: separator separator: ', ' field_api_classes: false + category: + id: category + table: epal_criteria + field: category + relationship: none + group_type: group + admin_label: '' + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: + link_to_entity: false + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + entity_type: epal_criteria + entity_field: category + plugin_id: field mutual_disabled_id: id: mutual_disabled_id table: epal_criteria @@ -279,6 +346,74 @@ display: entity_type: epal_criteria entity_field: mutual_disabled_id plugin_id: field + moria: + id: moria + table: epal_criteria + field: moria + relationship: none + group_type: group + admin_label: '' + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: number_decimal + settings: + thousand_separator: '' + prefix_suffix: true + decimal_separator: . + scale: 2 + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + entity_type: epal_criteria + entity_field: moria + plugin_id: field filters: { } sorts: { } header: { } @@ -326,9 +461,15 @@ display: name: alias: '' raw_output: true + category: + alias: '' + raw_output: true mutual_disabled_id: alias: '' raw_output: true + moria: + alias: points + raw_output: true auth: - basic_auth cache_metadata: diff --git a/source/components/student-application-form/application.form.main.html b/source/components/student-application-form/application.form.main.html index 530f2aaada670a104aa18756265b09bdbdd24f05..6664deb9a71be80e410e57486ef3c6a15a2ce258 100644 --- a/source/components/student-application-form/application.form.main.html +++ b/source/components/student-application-form/application.form.main.html @@ -36,6 +36,63 @@ Δεν επιτρέπονται ψηφία ή άλλοι μη έγκυροι χαρακτήρες σε αυτό το πεδίο! +
+ +
+
+ Το πεδίο δεν μπορεί να αφεθεί κενό! +
+
+ Δεν επιτρέπονται ψηφία ή άλλοι μη έγκυροι χαρακτήρες σε αυτό το πεδίο! +
+ +
+ +
+
+ Το πεδίο δεν μπορεί να αφεθεί κενό! +
+
+ Δεν επιτρέπονται ψηφία ή άλλοι μη έγκυροι χαρακτήρες σε αυτό το πεδίο! +
+ +
+ +
+
+ Το πεδίο δεν μπορεί να αφεθεί κενό! +
+
+ Δεν επιτρέπονται ψηφία ή άλλοι μη έγκυροι χαρακτήρες σε αυτό το πεδίο! +
+ +
+ +
+
+ Το πεδίο δεν μπορεί να αφεθεί κενό! +
+
+ Δεν επιτρέπονται ψηφία ή άλλοι μη έγκυροι χαρακτήρες σε αυτό το πεδίο! +
+ +
+ + +
+ +
+ Η ημερομηνία γέννησης πρέπει να είναι της μορφής ΗΗ/ΜΜ/ΕΕΕΕ +
+ +
+ Η ημερομηνία γέννησης πρέπει να είναι της μορφής ΗΗ/ΜΜ/ΕΕΕΕ +
+ + + + +
@@ -113,19 +170,19 @@ - Εισοδηματικά κριτήρια - + +
+ Εισοδηματικά κριτήρια +
+
+
+ +
+
+ {{criter$.name}} +
+
+
+ Κοινωνικά κριτήρια

Επιλέξτε όσα από τα παρακάτω κριτήρια πληρούνται για εσάς. Οι επιλογές σας επέχουν θέση υπέυθυνης δήλωσης. @@ -149,7 +219,7 @@

-
+
@@ -159,6 +229,7 @@
+
@@ -176,7 +247,7 @@
-
diff --git a/source/components/student-application-form/application.form.main.ts b/source/components/student-application-form/application.form.main.ts index 20ac6eb8c65ec59f628ac1f6a3ef4c29263a6ec2..3bdf91a335b8ef8915e7c2ce88871bf496f8e867 100644 --- a/source/components/student-application-form/application.form.main.ts +++ b/source/components/student-application-form/application.form.main.ts @@ -8,7 +8,7 @@ import { IStudentDataFields } from '../../store/studentdatafields/studentdatafie import { CriteriaActions } from '../../actions/criteria.actions'; import { ICriter } from '../../store/criteria/criteria.types'; import { IAppState } from '../../store/store'; -import { VALID_NAMES_PATTERN, VALID_ADDRESS_PATTERN, VALID_ADDRESSTK_PATTERN, VALID_DIGITS_PATTERN } from '../../constants'; +import { VALID_NAMES_PATTERN, VALID_ADDRESS_PATTERN, VALID_ADDRESSTK_PATTERN, VALID_DIGITS_PATTERN, VALID_DATE_PATTERN } from '../../constants'; import { STUDENT_DATA_FIELDS_INITIAL_STATE } from '../../store/studentdatafields/studentdatafields.initial-state'; import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-state'; @@ -38,7 +38,10 @@ import { public studentCriteriaGroup: FormGroup; private rss = new FormArray([]); - private selectionIncomeId = 0; + //private selectionIncomeId = 0; + + //private sdate;// = new Date(2013,7,29); // = Date.now(); + //date: [datePipe.transform(this.event.date, 'yyyy-MM-dd'), [Validators.required]] constructor(private fb: FormBuilder, private _sdfa: StudentDataFieldsActions, @@ -52,6 +55,12 @@ import { epaluser_id: [,[]], name: ['ΝΙΚΟΣ', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]], studentsurname: ['ΚΑΤΣΑΟΥΝΟΣ', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]], + //studentbirthdate: [this.sdate, [Validators.required]], + studentbirthdate: ['', [Validators.pattern(VALID_DATE_PATTERN),Validators.required]], + fatherfirstname: ['ΑΝΑΣΤΑΣΙΟΣ', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]], + fathersurname: ['ΚΑΤΣΑΟΥΝΟΣ', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]], + motherfirstname: ['ΚΑΤΕΡΙΝΑ', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]], + mothersurname: ['ΚΑΤΣΑΟΥΝΟΥ', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]], regionaddress: ['ΓΙΑΝΝΙΤΣΩΝ 5', [Validators.pattern(VALID_ADDRESS_PATTERN),Validators.required]], regiontk: ['26334', [Validators.pattern(VALID_ADDRESSTK_PATTERN),Validators.required]], regionarea: ['ΠΑΤΡΑ', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]], @@ -67,10 +76,10 @@ import { this.studentCriteriaGroup = this.fb.group({ formArray: this.rss, - income: ['', this.checkChoice ], + //income: ['', this.checkChoice ], //income: ['noincomecriterio', Validators.required ], //income: [this.selectionIncomeId, this.checkChoice ], - //incometest: ['noincomecriterio', checkChoice ], + //incometest: ['noincomecriterio', this. checkChoice ], }); }; @@ -92,9 +101,10 @@ import { if (state.criter.size > 0) { state.criter.reduce(({}, criteria) => { //this.studentCriteriaGroup.setValue(criteria); - if (criteria.selected === true && (criteria.name === "Εισόδημα" )) { - this.selectionIncomeId = Number(criteria.id); - } + + //if (criteria.selected === true && (criteria.name === "Εισόδημα" )) { + // this.selectionIncomeId = Number(criteria.id); + //} this.rss.push( new FormControl(criteria.selected, [])); return criteria; }, {}); @@ -117,11 +127,6 @@ import { submitSelected() { this._sdfa.saveStudentDataFields([this.studentDataGroup.value]); - - for (let i=7; i < 11; i++) - this.studentCriteriaGroup.controls['formArray']['controls'][i].setValue(false); - this.studentCriteriaGroup.controls['formArray']['controls'][this.selectionIncomeId-1].setValue(true); - this._sdfb.saveCriteria([this.studentCriteriaGroup.value.formArray]); this.router.navigate(['/application-submit']); @@ -129,11 +134,21 @@ import { checkcriteria(cb, mutual_disabled) { if (mutual_disabled !== "-1" && cb.checked === true) { - this.studentCriteriaGroup.controls['formArray']['controls'][mutual_disabled-1].setValue(false); + //this.studentCriteriaGroup.controls['formArray']['controls'][mutual_disabled-1].setValue(false); + let mutual_ids = mutual_disabled.split(","); + for (let i=0; i 9000 Ευρώ") this.selectionIncomeId = 11; } + */ //checkChoice(c: FormControl) { checkChoice(c: FormControl) { diff --git a/source/components/student-application-form/application.submit.ts b/source/components/student-application-form/application.submit.ts index 22302fd66c69c0d9d025ecc5d1432fe68acc1998..6adc0fe5028d44142e8d80fef32a5b5085f8d33f 100644 --- a/source/components/student-application-form/application.submit.ts +++ b/source/components/student-application-form/application.submit.ts @@ -41,6 +41,7 @@ import {AppSettings} from '../../app.settings'; private courseSelected; private sectorSelected; private classSelected; + private totalPoints= 0; private studentDataFields$: BehaviorSubject; private regions$: BehaviorSubject; private criteria$: BehaviorSubject; @@ -120,8 +121,11 @@ import {AppSettings} from '../../app.settings'; if (state.criter.size > 0) { state.criter.reduce(({}, criteria) => { //code to be replaced in next version - if (criteria.selected === true && Number(criteria.id) !== 11) + //if (criteria.selected === true && Number(criteria.id) !== 11) + if (criteria.selected === true ) { this.studentCriteria.push(Number(criteria.id)); + this.totalPoints = this.totalPoints + Number(criteria.points); + } return criteria; }, {}); @@ -129,7 +133,6 @@ import {AppSettings} from '../../app.settings'; return state.criter; }).subscribe(this.criteria$); - this.sectorsSub = this._ngRedux.select(state => { state.sectors.reduce((prevSector, sector) =>{ sector.courses.reduce((prevCourse, course) =>{ @@ -178,10 +181,11 @@ import {AppSettings} from '../../app.settings'; let epalObj: Array = []; let criteriaObj: Array = []; - //aitisiObj[0] = studentDataFields["_tail"]["array"][0]; aitisiObj[0] = this.student; + //console.log(aitisiObj[0]['studentbirthdate']); aitisiObj[0]['currentclass'] = this.classSelected; //aitisiObj[0]['studentamka'] = ...; + aitisiObj[0]['points'] = this.totalPoints; for (let i=0; i < this.epalSelected.length; i++) epalObj[i] =new StudentEpalChosen(null, this.epalSelected[i] , this.epalSelectedOrder[i]); diff --git a/source/components/students/student.ts b/source/components/students/student.ts index 1d7c68df3cc2918f877decfa7e7098a273a9a1c0..95fe6e39e83bb30e1a4216d0da511a3a7ad2dd93 100644 --- a/source/components/students/student.ts +++ b/source/components/students/student.ts @@ -6,6 +6,7 @@ export class Student { public epaluser_id: number, public name: string, public studentsurname: string, + //public studentbirthdate: Date, public regionaddress: string, public regiontk: string, public regionarea: string, diff --git a/source/constants.ts b/source/constants.ts index 2c9d0f5fbce44ca8af1553ca7ceeac8ba0ada6f2..cbdb99a4354cdf0b8702f4476e0b3854c70f52ad 100644 --- a/source/constants.ts +++ b/source/constants.ts @@ -36,4 +36,14 @@ export const VALID_NAMES_PATTERN = '[A-Za-zΑ-ΩΆΈΉΊΎΌΏα-ωάέήίύό export const VALID_ADDRESS_PATTERN = '[0-9A-Za-zΑ-ΩΆΈΉΊΎΌΏα-ωάέήίύόώ ]*$'; export const VALID_ADDRESSTK_PATTERN = '[0-9 ]*$'; export const VALID_DIGITS_PATTERN = '[0-9]*$'; + export const VALID_EMAIL_PATTERN = '[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}'; + +//YYYY-MM-DD FULL +//export const VALID_DATE_PATTERN = '(?:19|20)[0-9]{2}/(?:(?:0[1-9]|1[0-2])/(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))'; + +//MM-DD-YYYY FULL +//export const VALID_DATE_PATTERN = '(?:(?:0[1-9]|1[0-2])[\/\\-. ]?(?:0[1-9]|[12][0-9])|(?:(?:0[13-9]|1[0-2])[\/\\-. ]?30)|(?:(?:0[13578]|1[02])[\/\\-. ]?31))[\/\\-. ]?(?:19|20)[0-9]{2}'; + +//DD-MM-YYYY +export const VALID_DATE_PATTERN = '([1-9]|0[1-9]|[12][0-9]|3[01])[- /.]([1-9]|0[1-9]|1[012])[- /.](19|20)[0-9][0-9]'; diff --git a/source/services/helper-data-service.ts b/source/services/helper-data-service.ts index 59936f86c00bc5591f42bbfedf5d124576e454bf..a734068121955140aa99e9a49b427dfca66a8586 100644 --- a/source/services/helper-data-service.ts +++ b/source/services/helper-data-service.ts @@ -326,6 +326,7 @@ export class HelperDataService implements OnInit, OnDestroy{ } getCriteria() { + this.loginInfo$.forEach(loginInfoToken => { console.log(loginInfoToken.get(0)); this.authToken = loginInfoToken.get(0).auth_token; @@ -339,6 +340,7 @@ export class HelperDataService implements OnInit, OnDestroy{ let options = new RequestOptions({ headers: headers }); return new Promise((resolve, reject) => { this.http.get(`${AppSettings.API_ENDPOINT}/criteria/list`, options) + //this.http.get(`${AppSettings.API_ENDPOINT}/criteria/list?category=${category}`, options) .map(response => response.json()) .subscribe(data => { resolve(data); diff --git a/source/store/criteria/criteria.reducer.ts b/source/store/criteria/criteria.reducer.ts index 24af1c9d10778300c635dc476007df609855d368..4b5982853d1e62d1fec148c25edcb5ca92318d6f 100644 --- a/source/store/criteria/criteria.reducer.ts +++ b/source/store/criteria/criteria.reducer.ts @@ -13,7 +13,8 @@ export function criteriaReducer(state: ICriter = CRITERIA_INITIAL_STATE, action) let newCriter = Array(); let i=0; action.payload.criteria.forEach(criteria => { - newCriter.push({id: criteria.id, name: criteria.name, mutual_disabled_id: criteria.mutual_disabled_id, selected: false}); + newCriter.push({id: criteria.id, name: criteria.name, category: criteria.category, + points: criteria.points, mutual_disabled_id: criteria.mutual_disabled_id, selected: false}); i++; }); return Seq(newCriter).map(n => n).toList(); @@ -22,7 +23,8 @@ export function criteriaReducer(state: ICriter = CRITERIA_INITIAL_STATE, action) let criter = Array(); let ind=0; state.forEach(criteria => { - criter.push({id: criteria.id, name: criteria.name, mutual_disabled_id: criteria.mutual_disabled_id, selected: action.payload.criter[0][ind]}); + criter.push({id: criteria.id, name: criteria.name, category: criteria.category, + points: criteria.points, mutual_disabled_id: criteria.mutual_disabled_id, selected: action.payload.criter[0][ind]}); ind++; }); diff --git a/source/store/criteria/criteria.transformers.ts b/source/store/criteria/criteria.transformers.ts index 4a4035ffab710c974c641e953271fab1aeb6b041..42b5327295585a3e3ee1bf89bd5954cf5352a9ae 100644 --- a/source/store/criteria/criteria.transformers.ts +++ b/source/store/criteria/criteria.transformers.ts @@ -4,7 +4,8 @@ export function deimmutifyCriteria(state: ICriter): ICriteria[] { let fetchedCriteria = new Array(); state.forEach(criteria => { - fetchedCriteria.push({id: criteria.id, name: criteria.name, mutual_disabled_id: criteria.mutual_disabled_id, selected: criteria.selected, + fetchedCriteria.push({id: criteria.id, name: criteria.name, category: criteria.category, + mutual_disabled_id: criteria.mutual_disabled_id, points: criteria.points, selected: criteria.selected, }); }); return fetchedCriteria; diff --git a/source/store/criteria/criteria.types.ts b/source/store/criteria/criteria.types.ts index 1bd047812c796e4a0b9f8c26a21026100b029fd4..00797e1efa909917e99163388e5cb652f062b926 100644 --- a/source/store/criteria/criteria.types.ts +++ b/source/store/criteria/criteria.types.ts @@ -3,7 +3,9 @@ import { List } from 'immutable'; export interface ICriteria { id: string; name: string; - mutual_disabled_id: string, + category: string; + mutual_disabled_id: string; + points: string; selected: boolean; } diff --git a/source/store/studentdatafields/studentdatafields.transformers.ts b/source/store/studentdatafields/studentdatafields.transformers.ts index d9072db7ce6d2e5799892db23fe95ca6b1f0815e..5898769479fab1163d9eed8aa530c5b62557bc5c 100644 --- a/source/store/studentdatafields/studentdatafields.transformers.ts +++ b/source/store/studentdatafields/studentdatafields.transformers.ts @@ -15,11 +15,13 @@ export function deimmutifyStudentDataFields(state: IStudentDataFields): IStudent */ state.forEach(studentdataField => { fetchedStudentDataFields.push({epaluser_id:studentdataField.epaluser_id, - name: studentdataField.name, studentsurname: studentdataField.studentsurname, + name: studentdataField.name, studentsurname: studentdataField.studentsurname, studentbirthdate: studentdataField.studentbirthdate, + fatherfirstname: studentdataField.fatherfirstname, fathersurname: studentdataField.fathersurname, + motherfirstname: studentdataField.motherfirstname, mothersurname: studentdataField.mothersurname, studentamka: studentdataField.studentamka, regionaddress: studentdataField.regionaddress, regiontk: studentdataField.regiontk,regionarea: studentdataField.regionarea, certificatetype: studentdataField.certificatetype, relationtostudent: studentdataField.relationtostudent, - currentclass: studentdataField.currentclass + currentclass: studentdataField.currentclass, points: studentdataField.points }); }); return fetchedStudentDataFields; diff --git a/source/store/studentdatafields/studentdatafields.types.ts b/source/store/studentdatafields/studentdatafields.types.ts index 91a4cd62340388cb2cff5ece230408df847f1d88..5c856b141f1a500e627fff18efed9aff7053a6c5 100644 --- a/source/store/studentdatafields/studentdatafields.types.ts +++ b/source/store/studentdatafields/studentdatafields.types.ts @@ -18,6 +18,11 @@ export interface IStudentDataField { epaluser_id: number; name: string; studentsurname: string; + fatherfirstname:string; + fathersurname:string; + motherfirstname:string; + mothersurname:string; + studentbirthdate: Date; studentamka: string; regionaddress: string; regiontk: string; @@ -25,6 +30,7 @@ export interface IStudentDataField { certificatetype: string; relationtostudent: string; currentclass: string; + points: number; } export type IStudentDataFields = List;