Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring/database #35

Merged
merged 76 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
4671df3
chore: Update SocialMediaDTO and CriteriaDTO to use consistent naming…
FelipeCarillo May 13, 2024
780a725
chore: Add Mocks
FelipeCarillo May 13, 2024
61b4b30
chore: Update repository interfaces
FelipeCarillo May 13, 2024
f3387b3
Refactor Entity tests to remove unnecessary assertions
FelipeCarillo May 13, 2024
082f128
Refactor Entity tests to remove unnecessary assertions
FelipeCarillo May 13, 2024
cef5bb5
chore: Update UserMock and CourseMock with new course options
FelipeCarillo May 13, 2024
38c357c
chore: Add repository mocks and databases for Country, Language, Soci…
FelipeCarillo May 13, 2024
061cffe
chore: Remove unused Course entity and related code
FelipeCarillo May 14, 2024
cddb234
chore: Update create_activity_presenter and create_activity_usecase
FelipeCarillo May 14, 2024
6d5283a
chore: Remove unused update user module files
FelipeCarillo May 14, 2024
861bf86
chore: Remove unused get_all_courses module files
FelipeCarillo May 14, 2024
946fa46
chore: Remove unused get_all_courses module files
FelipeCarillo May 14, 2024
a929b24
chore: Remove ConflictError import and usage in assign_user_controller
FelipeCarillo May 14, 2024
951d78e
feat: Add GetActivityRequirements module
FelipeCarillo May 14, 2024
9ec7731
chore: Update get_activity_presenter to fix import issue
FelipeCarillo May 14, 2024
6971695
chore: Add tests for Create Moderator Presenter
FelipeCarillo May 14, 2024
f02ec03
chore: Remove unused create_moderator module files
FelipeCarillo May 14, 2024
9d092d6
chore: Add tests for Create Institution Presenter
FelipeCarillo May 14, 2024
63f199d
chore: Add tests for Create Activity Presenter
FelipeCarillo May 14, 2024
f26402c
chore: Fix indentation in assign_user.test.ts and auth_user.test.ts
FelipeCarillo May 14, 2024
e56d8b2
chore: Update update_activity_event_presenter to use async/await syntax
FelipeCarillo May 14, 2024
02285e7
refactor: Update ActivityDTO properties to use consistent naming conv…
FelipeCarillo May 14, 2024
852c659
chore: Refactor InstitutionDTO to use consistent object structure
FelipeCarillo May 14, 2024
18f4ec9
chore: Add method to retrieve all institution names
FelipeCarillo May 14, 2024
e69694b
chore: Update language mock import in Activity.test.ts
FelipeCarillo May 14, 2024
2eba989
refactor: Update Institution entity to use consistent object structur…
FelipeCarillo May 14, 2024
deb3ef0
refactor: Update Country entity to use nullable types for country and…
FelipeCarillo May 14, 2024
b6e7f5e
refactor: Update InstitutionRepo to include method for retrieving all…
FelipeCarillo May 14, 2024
fc99a12
refactor: Update InstitutionMock to include additional countries and …
FelipeCarillo May 14, 2024
5a66ed6
refactor: Simplify code in InstitutionRepoMock by using arrow functio…
FelipeCarillo May 14, 2024
01e78fe
refactor: Update ActivityRepo to include attributes for courses, lang…
FelipeCarillo May 14, 2024
eb31da4
refactor: Update ActivityRepoMock to improve get_activity method
FelipeCarillo May 14, 2024
11775cf
refactor: Update SocialMediaRepoMock to fix import statement for Soci…
FelipeCarillo May 14, 2024
78d038a
refactor: Update GetActivityRequirementsUsecase to include institutio…
FelipeCarillo May 14, 2024
40bdc73
refactor: Update GetActivityRequirementsUsecase to include institutio…
FelipeCarillo May 14, 2024
47d8488
refactor: Add tests for Get Activity Requirements Presenter
FelipeCarillo May 14, 2024
c7e2de4
refactor: Remove unused test file for getting all courses
FelipeCarillo May 14, 2024
19f63d0
refactor: Remove commented out code in update_activity.test.ts
FelipeCarillo May 14, 2024
7027acb
refactor: Update UpdateUserPresenter tests and remove unused code
FelipeCarillo May 14, 2024
47fe68c
refactor: Update UpdateUserUsecase tests and remove unused code
FelipeCarillo May 14, 2024
198c16e
refactor: Update UpdateActivityUsecase to handle courses and criteria…
FelipeCarillo May 14, 2024
c386b04
refactor: Update GetAllInstitutionsUsecase to include countries as an…
FelipeCarillo May 14, 2024
46581ec
refactor: Update GetAllActivitiesEnrolledUsecase to return activities…
FelipeCarillo May 14, 2024
cc7a1e0
refactor: Update GetActivityRequirementsUsecase to use "criterias" in…
FelipeCarillo May 14, 2024
6ddc10d
refactor: Update GetActivityRequirementsController to return activity…
FelipeCarillo May 14, 2024
d86269e
refactor: Update CreateModeratorUsecase to handle existing users as m…
FelipeCarillo May 14, 2024
dcec3d0
refactor: Update ActivityRepo to include countries in activity details
FelipeCarillo May 14, 2024
85b6d66
refactor: Update CreateInstitutionUsecase to handle multiple countrie…
FelipeCarillo May 14, 2024
07112e5
refactor: Update Course entity constructor to set a default value for…
FelipeCarillo May 14, 2024
7427d95
refactor: Update Get All Activities Enrolled Presenter to use Activit…
FelipeCarillo May 14, 2024
7c6aaa6
refactor: Update ActivityRepo to include countries in activity details
FelipeCarillo May 14, 2024
b3b41b9
refactor: Update CreateActivityUsecase to exclude test environment fr…
FelipeCarillo May 14, 2024
670e809
refactor: Update CreateInstitutionUsecase to handle multiple countrie…
FelipeCarillo May 14, 2024
5a7b9fb
refactor: Update UpdateInstitutionUsecase to handle social media link…
FelipeCarillo May 14, 2024
3818426
Delete iac/docker-compose.yml
FelipeCarillo May 15, 2024
3478d2a
refactor: Remove unused docker-compose.yml file
FelipeCarillo May 15, 2024
9ed75f1
refactor: Update CreateOrUpdateUser function to handle existing users…
FelipeCarillo May 15, 2024
1e99836
refactor: Update ActivityRepo to fix whitespace issue
FelipeCarillo May 15, 2024
39fa902
refactor: Update InstitutionRepo to use social media IDs instead of m…
FelipeCarillo May 15, 2024
9ce1ed2
refactor: Update CreateActivityUsecase to validate and handle input p…
FelipeCarillo May 15, 2024
3cd3541
refactor: Update CreateInstitutionUsecase to validate images, social …
FelipeCarillo May 15, 2024
3ce7f58
refactor: Remove unused import in get_user_usecase.ts
FelipeCarillo May 15, 2024
7fad1fe
refactor: Add validation for languages, courses, criterias, and partn…
FelipeCarillo May 15, 2024
84faeb1
refactor: Update UpdateInstitutionUsecase to handle social media link…
FelipeCarillo May 15, 2024
c981d59
refactor: Update CreateInstitutionUsecase to validate images, social …
FelipeCarillo May 15, 2024
782a6ea
refactor: Improve error handling and validation in CreateActivityUsecase
FelipeCarillo May 15, 2024
61e9542
refactor: Update CreateInstitutionController to handle InvalidRequest…
FelipeCarillo May 15, 2024
2785aa5
refactor: Improve error handling and validation in UpdateActivityUsecase
FelipeCarillo May 15, 2024
d5cd3b0
refactor: Update UpdateInstitutionUsecase to handle social media link…
FelipeCarillo May 15, 2024
faf7e54
refactor: Update UpdateActivityPresenter to handle language, criteria…
FelipeCarillo May 15, 2024
9a37cde
Merge branch 'refactoring/database' of https://github.com/Instituto-M…
FelipeCarillo May 15, 2024
58d2c47
Delete a.ts
FelipeCarillo May 15, 2024
d8db783
Delete main.ts
FelipeCarillo May 15, 2024
23686f2
refactor: Add get_activity_requirements function to LambdaStack
FelipeCarillo May 15, 2024
2f1d3f8
Merge branch 'refactoring/database' of https://github.com/Instituto-M…
FelipeCarillo May 15, 2024
7eb927d
Delete docker-compose.yml
FelipeCarillo May 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: Update UserMock and CourseMock with new course options
  • Loading branch information
FelipeCarillo committed May 13, 2024
commit cef5bb5c537fcdc5c3c835c972aecb0083f829fe
8 changes: 0 additions & 8 deletions src/core/structure/entities/Institution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,6 @@ export class Institution {
if (!Array.isArray(social_medias)) {
throw new EntityError("Parameter social_medias must be an array of objects")
}
for (const social_media of social_medias) {
if (typeof social_media.media !== "object") {
throw new EntityError("Each media in the social_medias array must be an object")
}
if (typeof social_media.link !== "string") {
throw new EntityError("Each link in the social_medias array must be a string")
}
}
return social_medias;
}
}
4 changes: 2 additions & 2 deletions src/core/structure/mocks/ActivityMock.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { UserMock } from "./UserMock";
import { CourseMock } from "./CourseMock";
import { CriteriaMock } from "./CriteriaMock";
import { LanguagesMock } from "./LanguagesMock";
import { LanguageMock } from "./LanguageMock";
import { InstitutionMock } from "./InstitutionMock";

import { Activity } from "../entities/Activity";
Expand All @@ -13,7 +13,7 @@ export class ActivityMock {
private user_mock: UserMock = new UserMock();
private course_mock: CourseMock = new CourseMock();
private criteria_mock: CriteriaMock = new CriteriaMock();
private languages_mock: LanguagesMock = new LanguagesMock();
private languages_mock: LanguageMock = new LanguageMock();
private institution_mock: InstitutionMock = new InstitutionMock();

constructor() {
Expand Down
60 changes: 16 additions & 44 deletions src/core/structure/mocks/CourseMock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,22 @@ export class CourseMock {

constructor() {
this.courses = [
new Course({
id: 1,
course: "Computer Science"
}),
new Course({
id: 2,
course: "Information Systems"
}),
new Course({
id: 3,
course: "Data Science and Artificial Intelligence"
}),
new Course({
id: 4,
course: "Computer Engineering"
}),
new Course({
id: 5,
course: "Industrial Engineering"
}),
new Course({
id: 6,
course: "Control and Automation Engineering"
}),
new Course({
id: 7,
course: "Electrical Engineering"
}),
new Course({
id: 8,
course: "Mechanical Engineering"
}),
new Course({
id: 9,
course: "Chemical Engineering"
}),
new Course({
id: 10,
course: "Food Engineering"
}),
new Course({
id: 11,
course: "Civil Engineering"
})
new Course({ id: 1, course: "Administration"}),
new Course({ id: 2, course: "Architecture and Urbanism"}),
new Course({ id: 3, course: "Computer Science"}),
new Course({ id: 4, course: "Design"}),
new Course({ id: 5, course: "Civil Engineering"}),
new Course({ id: 6, course: "Food Engineering"}),
new Course({ id: 7, course: "Computer Engineering"}),
new Course({ id: 8, course: "Control and Automation Engineering"}),
new Course({ id: 9, course: "Production Engineering"}),
new Course({ id: 10, course: "Electrical Engineering"}),
new Course({ id: 10, course: "Eletrotechnical Engineering"}),
new Course({ id: 11, course: "Mechanical Engineering"}),
new Course({ id: 12, course: "Chemical Engineering"}),
new Course({ id: 13, course: "Artificial Intelligence and Data Science"}),
new Course({ id: 14, course: "International Relations"}),
new Course({ id: 15, course: "Information Systems"}),
];
}
}
Original file line number Diff line number Diff line change
@@ -1,93 +1,93 @@
import { Language } from "../entities/Language";

export class LanguagesMock {
export class LanguageMock {
public languages: Language[];

constructor() {
this.languages = [
new Language({
id: 1,
language: "Português",
language: "Portuguese",
language_code: "pt"
}),
new Language({
id: 2,
language: "Inglês",
language: "English",
language_code: "en"
}),
new Language({
id: 3,
language: "Espanhol",
language: "Spanish",
language_code: "es"
}),
new Language({
id: 4,
language: "Francês",
language: "French",
language_code: "fr"
}),
new Language({
id: 5,
language: "Alemão",
language: "German",
language_code: "de"
}),
new Language({
id: 6,
language: "Italiano",
language: "Italian",
language_code: "it"
}),
new Language({
id: 7,
language: "Mandarim",
language: "Mandarin",
language_code: "zh"
}),
new Language({
id: 8,
language: "Japonês",
language: "Japanese",
language_code: "ja"
}),
new Language({
id: 9,
language: "Coreano",
language: "Korean",
language_code: "ko"
}),
new Language({
id: 10,
language: "Árabe",
language: "Arabic",
language_code: "ar"
}),
new Language({
id: 11,
language: "Russo",
language: "Russian",
language_code: "ru"
}),
new Language({
id: 12,
language: "Holandês",
language: "Dutch",
language_code: "nl"
}),
new Language({
id: 13,
language: "Sueco",
language: "Swedish",
language_code: "sv"
}),
new Language({
id: 14,
language: "Dinamarquês",
language: "Danish",
language_code: "da"
}),
new Language({
id: 15,
language: "Norueguês",
language: "Norwegian",
language_code: "no"
}),
new Language({
id: 16,
language: "Finlandês",
language: "Finnish",
language_code: "fi"
}),
new Language({
id: 17,
language: "Polonês",
language: "Polish",
language_code: "pl"
}),
];
Expand Down
4 changes: 2 additions & 2 deletions src/core/structure/mocks/UserMock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { UserTypeEnum } from "../../helpers/enums/UserTypeEnum";

export class UserMock {
public users: User[];

constructor() {
this.users = [
new User({
Expand Down Expand Up @@ -35,6 +35,6 @@ export class UserMock {
updated_at: new Date()
}
)
];
];
}
}