Skip to content

Commit

Permalink
Merge branch 'cri' into filtros
Browse files Browse the repository at this point in the history
  • Loading branch information
LazaroDGM committed Jul 5, 2022
2 parents bd799a7 + 70f6fca commit 14bdafe
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 55 deletions.
103 changes: 88 additions & 15 deletions src/SchoolManagementSystem.Infrastructure/Data/SchoolInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public static class SchoolInitializer
Name = "Frank",
PhoneNumber = 57881239,
};
static Tuitor roger = new Tuitor { Name = "Roger", PhoneNumber = 54444444 };

#region Students
static Student sasha = new Student{
Expand Down Expand Up @@ -89,6 +90,27 @@ public static class SchoolInitializer
ScholarityLevel = Domain.Enums.Education.Preuniversitario,
Tuitor = frank
};
static Student Jorgito = new Student {
IDCardNo = "14253681562",
Name = "Jorgito",
LastName = "Gonzalez Gutierrez",
PhoneNumber = 54763443,
Address = "Test Direccion de jorgito",
DateBecomedMember = new DateTime(2022, 3, 5),
ScholarityLevel = Domain.Enums.Education.Primaria
};
static Student Guillermo = new Student
{
IDCardNo = "99111165645",
Name = "Guillermo",
LastName = "Rodriguez de Vivar",
PhoneNumber = 53545515,
Address = "Test Direccion de Guillermo",
DateBecomedMember = new DateTime(2020, 11, 25),
Tuitor = roger,
Founds = 2,
ScholarityLevel = Domain.Enums.Education.Universidad
};

#endregion

Expand All @@ -105,6 +127,7 @@ public static class SchoolInitializer
#endregion

#region Courses
static Course aleman = new Course { Name = "Aleman 1", Price = 55, Type = "Idioma" };
static Course algebra = new Course{
Name = "Algebra",
Price = 200,
Expand Down Expand Up @@ -163,7 +186,25 @@ public static class SchoolInitializer
StartDate = new DateTime(2020,01,01),
EndDate = new DateTime(2020,11,09),
};

static CourseGroup Aleman = new CourseGroup
{
Course = aleman,
Name = "Aula T2",
Capacity = 14,
StartDate = new DateTime(2022, 3, 12),
EndDate = new DateTime(2022, 5, 12),
Teacher = new Teacher
{
IDCardNo = "00523573122",
Name = "Leo",
LastName = "LLosa",
PhoneNumber = 55555555,
Address = "Calle Berlin",
DateBecomedMember = new DateTime(2020, 5, 14),
CourseGroups = new List<CourseGroup>()
}
};

#endregion

#endregion
Expand Down Expand Up @@ -526,11 +567,12 @@ private static Student[] GetStudents()
DateBecomedMember = new DateTime(2020, 2, 1),
Tuitor = new Tuitor { Name = "Elena", PhoneNumber = 54637721 }, Founds = 3,
ScholarityLevel = Domain.Enums.Education.Posgrado },
new Student { IDCardNo = "123456789012", Name = "Pablo", LastName = "Curbelo Paez", PhoneNumber = 56784392,
Address = "Pocitos No.23 e/ Czda de Vento y ALmendares",
new Student { IDCardNo = "12312312312", Name = "Pablito", LastName = "Curbelito Paecito", PhoneNumber = 56784555,
Address = "Se mudo",
DateBecomedMember = new DateTime(2020, 2, 1),
Tuitor = new Tuitor { Name = "Elena", PhoneNumber = 54637721 }, Founds = 3,
ScholarityLevel = Domain.Enums.Education.Primaria },

};
}

Expand All @@ -540,6 +582,7 @@ private static Tuitor[] GetTuitors()
{
new Tuitor { Name = "Josefa", PhoneNumber = 54674982 },
new Tuitor { Name = "Mari", PhoneNumber = 54637121 },
new Tuitor{ Name = "Roger", PhoneNumber = 54444444 },
};
}

Expand Down Expand Up @@ -620,11 +663,11 @@ private static StudentPaymentRecordForAdditionalService[] GetStudentPaymentRecor
}
};
}

private static StudentPaymentRecordPerCourseGroup[] GetStudentPaymentRecordPerCourseGroups()
{
var course = new Course { Name = "Transito 101", Price = 16, Type = "Transito" };

var courseGroup = new CourseGroup
{
Course = course,
Expand All @@ -637,6 +680,7 @@ private static StudentPaymentRecordPerCourseGroup[] GetStudentPaymentRecordPerCo
CourseGroups = new List<CourseGroup>() }
};


var student = new Student
{
IDCardNo = "93084574542", Name = "Pablo", LastName = "Curbelo Paez", PhoneNumber = 56784392,
Expand All @@ -645,8 +689,7 @@ private static StudentPaymentRecordPerCourseGroup[] GetStudentPaymentRecordPerCo
Tuitor = new Tuitor { Name = "Elena", PhoneNumber = 54637721 }, Founds = 3,
ScholarityLevel = Domain.Enums.Education.Posgrado
};

return new []
return new StudentPaymentRecordPerCourseGroup[]
{
new StudentPaymentRecordPerCourseGroup
{
Expand All @@ -661,16 +704,27 @@ private static StudentPaymentRecordPerCourseGroup[] GetStudentPaymentRecordPerCo

new StudentPaymentRecordPerCourseGroup
{
CourseGroup = courseGroup,
CourseGroupCourseId = course.Id,
CourseGroupId = courseGroup.Id,
CourseGroup = Aleman,
CourseGroupCourseId = Aleman.Id,
CourseGroupId = Aleman.Id,
Date = new DateTime(2017,8,20),
DatePaid = new DateTime(2017,9, 14),
StudentId = student.Id,
Student = student
DatePaid = new DateTime(2022, 5, 12),
StudentId = Guillermo.Id,
Student = Guillermo
},
new StudentPaymentRecordPerCourseGroup
{
CourseGroup = Aleman,
CourseGroupCourseId = Aleman.Id,
CourseGroupId = Aleman.Id,
Date = new DateTime(2017,8,20),
DatePaid = new DateTime(2022, 5, 12),
StudentId = Jorgito.Id,
Student = Jorgito
}
};
}
// agregar mas

private static WorkerPayRecordByPosition[] GetWorkerPayRecordByPositions()
{
Expand Down Expand Up @@ -750,7 +804,7 @@ private static StudentCourseGroupRelation[] GetStudentCourseGroupRelations()
},
Founds = 3, ScholarityLevel = Domain.Enums.Education.Posgrado
};
return new []
return new StudentCourseGroupRelation[]
{
new StudentCourseGroupRelation
{
Expand Down Expand Up @@ -830,8 +884,27 @@ private static StudentCourseGroupRelation[] GetStudentCourseGroupRelations()
StartDate = historiaDelArte.StartDate,
Student = Carlos,
StudentId = Carlos.Id
},
new StudentCourseGroupRelation
{
CourseGroup = Aleman,
CourseGroupCourseId = Aleman.Id,
CourseGroupId = Aleman.Id,
EndDate = Aleman.EndDate,
StartDate = Aleman.StartDate,
Student = Guillermo,
StudentId = Guillermo.Id
},
new StudentCourseGroupRelation
{
CourseGroup = Aleman ,
CourseGroupCourseId = Aleman.Id,
CourseGroupId = Aleman.Id,
EndDate = Aleman.EndDate,
StartDate = Aleman.StartDate,
Student = Jorgito,
StudentId = Jorgito.Id
}

};
}

Expand Down
36 changes: 0 additions & 36 deletions src/SchoolManagementSystem.Presentation/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/SchoolManagementSystem.Presentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"react-bootstrap": "^2.4.0",
"react-dom": "^18.2.0",
"react-faq-component": "^1.3.4",
"react-highlight-words": "^0.18.0",
"react-router-dom": "^6.3.0",
"react-scripts": "^5.0.1",
"school-calendar-react": "^1.0.1",
Expand Down
32 changes: 29 additions & 3 deletions src/SchoolManagementSystem.Presentation/src/pages/Students.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const Students = () => {
message: "Introduzca el nombre."
},
{
pattern: /^\S{2,}(\s\S{2,})?(\s\S{2,})?(\s\S{2,})?$/,
pattern: /^[a-zA-Z]{2,}(\s[a-zA-Z]{2,})?(\s[a-zA-Z]{2,})?(\s[a-zA-Z]{2,})?$/,
message: 'El nombre solo puede contener letras (dos como mínimo). En caso de ser compuesto, deben estar separados por un único espacio.'
},
],
Expand All @@ -202,7 +202,7 @@ const Students = () => {
message: "Introduzca los apellidos."
},
{
pattern: /^\S{2,}(\s\S{2,})?(\s\S{2,})?(\s\S{2,})?$/,
pattern: /^[a-zA-Z]{2,}(\s[a-zA-Z]{2,})?(\s[a-zA-Z]{2,})?(\s[a-zA-Z]{2,})?$/,
message: 'Los apellidos solo pueden contener letras (dos como mínimo) y estar separados por un único espacio.'
},
],
Expand Down Expand Up @@ -248,6 +248,10 @@ const Students = () => {
{
whitespace: true,
message: "Introduzca la dirección."
},
{
pattern: /^[a-zA-Z0-9,#/&\-.\s]{1,100}$/,
message: "La dirección debe tener máximo 100 caracteres."
}
],
...getColumnSearchProps('address')
Expand All @@ -268,6 +272,11 @@ const Students = () => {
{
whitespace: true,
message: "Introduzca el grado de escolaridad."
},
{
pattern: /^\bPrimaria|Secundaria|EscuelaOficios|TecnicoMedio|Preuniversitario|Universidad|Posgrado\b$/,
message: "El nivel escolar debe ser de uno de los siguientes tipos: Primaria, Secundaria, EscuelaOficios, " +
"TecnicoMedio, Preuniversitario, Universidad, Posgrado."
}
],
filters: levels(),
Expand All @@ -290,6 +299,11 @@ const Students = () => {
{
whitespace: true,
message: "Introduzca la fecha de inicio en la sede."
},
{
//pattern: /^(0[1-9]|1[0-2])[-/.](0[1-9]|[12][0-9]|3[01])[-/.]\d{4}$/,
pattern: /^\b1[-/.](0[1-9]|[12][0-9]|3[01])[-/.](19[0-9][0-9]|20[0-2][0-2])|2[-/.](0[1-9]|[12][0-9]|2[08])[-/.](19[0-9][0-9]|20[01][0-9]|2022)|3[-/.](0[1-9]|[12][0-9]|3[01])[-/.](19[0-9][0-9]|20[01][0-9]|2022)|4[-/.](0[1-9]|[12][0-9]|3[00])[-/.](19[0-9][0-9]|20[01][0-9]|2022)|5[-/.](0[1-9]|[12][0-9]|3[01])[-/.](19[0-9][0-9]|20[01][0-9]|2022)|6[-/.](0[1-9]|[12][0-9]|3[00])[-/.](19[0-9][0-9]|20[01][0-9]|2022)|7[-/.](0[1-9]|[12][0-9]|3[01])[-/.](19[0-9][0-9]|20[01][0-9]|2022)|8[-/.](0[1-9]|[12][0-9]|3[01])[-/.](19[0-9][0-9]|20[01][0-9]|2022)|9[-/.](0[1-9]|[12][0-9]|3[00])[-/.](19[0-9][0-9]|20[01][0-9]|2022)|10[-/.](0[1-9]|[12][0-9]|3[01])[-/.](19[0-9][0-9]|20[01][0-9]|2022)|11[-/.](0[1-9]|[12][0-9]|3[00])[-/.](19[0-9][0-9]|20[01][0-9]|2022)|12[-/.](0[1-9]|[12][0-9]|3[01])[-/.](19[0-9][0-9]|20[01][0-9]|2022)\b$/,
message: "El formato de la fecha debe ser M/d/yyyy. Ej: 4/22/2021."
}
],
...getColumnSearchProps('dateBecomeMember')
Expand All @@ -306,6 +320,10 @@ const Students = () => {
{
whitespace: true,
message: "Introduzca el número de teléfono."
},
{
pattern: /^\d$/,
message: 'El teléfono solo puede contener números.'
}
],
...getColumnSearchProps('phoneNumber')
Expand All @@ -326,6 +344,10 @@ const Students = () => {
{
whitespace: true,
message: "Introduzca los fondos."
},
{
pattern: /^\d$/,
message: 'Los fondos solo pueden contener números.'
}
],
filters: [
Expand All @@ -347,7 +369,7 @@ const Students = () => {
} else {
return record.founds <= value[1];
}
}
}
},
{
title: 'Nombre del tutor',
Expand All @@ -358,6 +380,10 @@ const Students = () => {
compare: (a, b) => a.tuitorName.localeCompare(b.tuitorName)
},
rules: [
{
pattern: /^[a-zA-Z]{2,}(\s[a-zA-Z]{2,})?(\s[a-zA-Z]{2,})?(\s[a-zA-Z]{2,})?$/,
message: 'El nombre solo puede contener letras (dos como mínimo). En caso de ser compuesto, deben estar separados por un único espacio.'
}
],
...getColumnSearchProps('tuitorName')
},
Expand Down

0 comments on commit 14bdafe

Please sign in to comment.