Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
Merge pull request #261 from CampusDual/BFS42024-325
Browse files Browse the repository at this point in the history
BFS42024-325
  • Loading branch information
GabrielAlonsoV authored Jan 15, 2025
2 parents a28c2c1 + 5808be7 commit a9b6303
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,11 @@
"festivos":"Holidays",
"holiday_date":"Holiday date",
"REQ_LHOLIDAY_DATE":"Holiday date*",
"students_summary": "Students",
"AsignarBoot" : "Assign bootcamps",
"StudentLaboralStat" : "Student laboral status",
"NewNote" : "New note",
"Note" : "Note",
"Session" : "Session",
"AcaData" : "Academic data"
"AcaData" : "Academic data",
"NOT_DELETABLE_TUTOR_TYPE_IS_DEFAULT": "The default mentor type cannot be deleted"
}
3 changes: 2 additions & 1 deletion cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@
"LHOLIDAYS":"Gestión de festivos",
"festivos":"Holidays",
"holiday_date":"Fecha del festivo",
"REQ_LHOLIDAY_DATE":"Fecha del festivo*"
"REQ_LHOLIDAY_DATE":"Fecha del festivo*",
"NOT_DELETABLE_TUTOR_TYPE_IS_DEFAULT": "El tipo de tutor que quieres eliminar es el por defecto"

}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ public EntityResult tutorTypeUpdate(Map<String, Object> attrMap, Map<String, Obj
@Override
public EntityResult tutorTypeDelete(Map<String, Object> keyMap) throws OntimizeJEERuntimeException {
try {
Integer id = (Integer) keyMap.get("id");
if (id <= 2){
EntityResult error = new EntityResultMapImpl();
error.setMessage("NOT_DELETABLE_TUTOR_TYPE_IS_DEFAULT");
error.setCode(EntityResult.OPERATION_WRONG);
return error;
}
return this.daoHelper.delete(this.tutorTypeDao, keyMap);
} catch (DataIntegrityViolationException e) {
EntityResult error = new EntityResultMapImpl();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

DELETE FROM public.tutors_type WHERE id IN (1,2);

INSERT INTO public.tutors_type (id, "type") VALUES(1, 'Titular');
INSERT INTO public.tutors_type (id, "type") VALUES(2, 'Apoyo');

ALTER TABLE tutor_bootcamp
ADD CONSTRAINT fk_tutor_type_bootcamp FOREIGN KEY (tutor_type) REFERENCES tutors_type(id);

0 comments on commit a9b6303

Please sign in to comment.