├── .classpath ├── .gitignore ├── .project ├── HELP.md ├── Readme.md ├── UML.md ├── UserStories.txt ├── backend └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── finance │ │ │ └── project │ │ │ ├── Bootstrapping.java │ │ │ ├── ProjectApplication.java │ │ │ ├── applicationLayer │ │ │ ├── applicationServices │ │ │ │ ├── groupServices │ │ │ │ │ ├── AddPersonToGroupService.java │ │ │ │ │ ├── CreateGroupAccountService.java │ │ │ │ │ ├── CreateGroupCategoryService.java │ │ │ │ │ ├── CreateGroupService.java │ │ │ │ │ ├── CreateGroupTransactionService.java │ │ │ │ │ ├── GroupSearchAccountRecordsService.java │ │ │ │ │ └── GroupTransactionsWithinPeriodService.java │ │ │ │ ├── otherServices │ │ │ │ │ ├── CheckGroupsFamilyService.java │ │ │ │ │ └── CheckSiblingsService.java │ │ │ │ └── personServices │ │ │ │ │ ├── CreatePersonAccountService.java │ │ │ │ │ ├── CreatePersonCategoryService.java │ │ │ │ │ ├── CreatePersonService.java │ │ │ │ │ ├── CreatePersonTransactionService.java │ │ │ │ │ └── PersonSearchAccountRecordsService.java │ │ │ └── services_here.txt │ │ │ ├── controllerLayer │ │ │ ├── controllers.here.txt │ │ │ └── controllersREST │ │ │ │ ├── errorHandling │ │ │ │ ├── ApiError.java │ │ │ │ └── CustomRestExceptionHandler.java │ │ │ │ ├── groupControllers │ │ │ │ ├── AddPersonToGroupControllerREST.java │ │ │ │ ├── CreateGroupAccountControllerREST.java │ │ │ │ ├── CreateGroupCategoryControllerREST.java │ │ │ │ ├── CreateGroupControllerREST.java │ │ │ │ ├── CreateGroupTransactionControllerREST.java │ │ │ │ └── GroupSearchAccountRecordsControllerREST.java │ │ │ │ ├── otherControllers │ │ │ │ ├── CheckGroupsFamilyControllerREST.java │ │ │ │ └── CheckSiblingsControllerREST.java │ │ │ │ └── personControllers │ │ │ │ ├── CreatePersonAccountControllerREST.java │ │ │ │ ├── CreatePersonCategoryControllerREST.java │ │ │ │ ├── CreatePersonControllerREST.java │ │ │ │ ├── CreatePersonTransactionControllerREST.java │ │ │ │ └── PersonSearchAccountRecordsControllerREST.java │ │ │ ├── dataModel │ │ │ ├── dataAssemblers │ │ │ │ ├── AccountDomainDataAssembler.java │ │ │ │ ├── CategoryDomainDataAssembler.java │ │ │ │ ├── GroupDomainDataAssembler.java │ │ │ │ ├── LedgerDomainDataAssembler.java │ │ │ │ └── PersonDomainDataAssembler.java │ │ │ └── dataModel │ │ │ │ ├── AbstractIdJpa.java │ │ │ │ ├── AccountJpa.java │ │ │ │ ├── AddressJpa.java │ │ │ │ ├── AdminJpa.java │ │ │ │ ├── CategoryJpa.java │ │ │ │ ├── GroupJpa.java │ │ │ │ ├── LedgerJpa.java │ │ │ │ ├── MemberJpa.java │ │ │ │ ├── PersonJpa.java │ │ │ │ ├── SiblingJpa.java │ │ │ │ └── TransactionJpa.java │ │ │ ├── domainLayer │ │ │ ├── domainEntities │ │ │ │ ├── aggregates │ │ │ │ │ ├── account │ │ │ │ │ │ └── Account.java │ │ │ │ │ ├── category │ │ │ │ │ │ └── Category.java │ │ │ │ │ ├── group │ │ │ │ │ │ └── Group.java │ │ │ │ │ ├── ledger │ │ │ │ │ │ ├── Ledger.java │ │ │ │ │ │ └── Transaction.java │ │ │ │ │ ├── person │ │ │ │ │ │ ├── Address.java │ │ │ │ │ │ ├── Birthdate.java │ │ │ │ │ │ ├── Birthplace.java │ │ │ │ │ │ ├── Name.java │ │ │ │ │ │ └── Person.java │ │ │ │ │ └── scheduling │ │ │ │ │ │ ├── Periodicity.java │ │ │ │ │ │ ├── Scheduling.java │ │ │ │ │ │ ├── SchedulingTask.java │ │ │ │ │ │ └── TriggerDate.java │ │ │ │ └── vosShared │ │ │ │ │ ├── AccountID.java │ │ │ │ │ ├── Amount.java │ │ │ │ │ ├── CategoryID.java │ │ │ │ │ ├── Date.java │ │ │ │ │ ├── DateOfCreation.java │ │ │ │ │ ├── Denomination.java │ │ │ │ │ ├── Description.java │ │ │ │ │ ├── Email.java │ │ │ │ │ ├── GroupID.java │ │ │ │ │ ├── LedgerID.java │ │ │ │ │ ├── PersonID.java │ │ │ │ │ ├── ScheduleID.java │ │ │ │ │ ├── TransactionType.java │ │ │ │ │ └── Type.java │ │ │ ├── entitiesInterfaces │ │ │ │ ├── Entity.java │ │ │ │ ├── Owner.java │ │ │ │ ├── OwnerID.java │ │ │ │ └── ValueObject.java │ │ │ ├── exceptions │ │ │ │ ├── InvalidArgumentsBusinessException.java │ │ │ │ ├── NotFoundArgumentsBusinessException.java │ │ │ │ └── TransactionsNotFoundException.java │ │ │ └── repositoriesInterfaces │ │ │ │ ├── IAccountRepository.java │ │ │ │ ├── ICategoryRepository.java │ │ │ │ ├── IGroupRepository.java │ │ │ │ ├── ILedgerRepository.java │ │ │ │ ├── IPersonRepository.java │ │ │ │ └── IScheduleRepository.java │ │ │ ├── dtos │ │ │ ├── dtos │ │ │ │ ├── AccountDTO.java │ │ │ │ ├── AccountsDTO.java │ │ │ │ ├── AddPersonToGroupDTO.java │ │ │ │ ├── BooleanDTO.java │ │ │ │ ├── CategoriesDTO.java │ │ │ │ ├── CheckIfSiblingsDTO.java │ │ │ │ ├── CreateGroupAccountDTO.java │ │ │ │ ├── CreateGroupCategoryDTO.java │ │ │ │ ├── CreateGroupDTO.java │ │ │ │ ├── CreateGroupTransactionDTO.java │ │ │ │ ├── CreatePersonAccountDTO.java │ │ │ │ ├── CreatePersonCategoryDTO.java │ │ │ │ ├── CreatePersonDTO.java │ │ │ │ ├── CreatePersonTransactionDTO.java │ │ │ │ ├── DeleteGroupTransactionDTO.java │ │ │ │ ├── DeletePersonTransactionDTO.java │ │ │ │ ├── GroupAdminsDTO.java │ │ │ │ ├── GroupAllMembersDTO.java │ │ │ │ ├── GroupDTO.java │ │ │ │ ├── GroupIDDTO.java │ │ │ │ ├── GroupListDTO.java │ │ │ │ ├── GroupMemberClearanceDTO.java │ │ │ │ ├── GroupMembersDTO.java │ │ │ │ ├── GroupSearchAccountRecordsInDTO.java │ │ │ │ ├── GroupTransactionsWithinPeriodDTOin.java │ │ │ │ ├── GroupTransactionsWithinPeriodDTOout.java │ │ │ │ ├── GroupsThatAreFamilyDTO.java │ │ │ │ ├── NewAddPersonToGroupInfoDTO.java │ │ │ │ ├── NewCreateGroupInfoDTO.java │ │ │ │ ├── NewCreatePersonInfoDTO.java │ │ │ │ ├── NewGroupAccountInfoDTO.java │ │ │ │ ├── NewGroupCategoryInfoDTO.java │ │ │ │ ├── NewGroupTransactionInfoDTO.java │ │ │ │ ├── NewPersonAccountInfoDTO.java │ │ │ │ ├── NewPersonCategoryInfoDTO.java │ │ │ │ ├── NewPersonTransactionInfoDTO.java │ │ │ │ ├── PersonDTO.java │ │ │ │ ├── PersonEmailDTO.java │ │ │ │ ├── PersonIDDTO.java │ │ │ │ ├── PersonSearchAccountRecordsInDTO.java │ │ │ │ ├── PersonSearchAccountRecordsOutDTO.java │ │ │ │ ├── PrepareInfoToCheckIfSiblingsDTO.java │ │ │ │ ├── SiblingsDTO.java │ │ │ │ ├── TransactionDTOout.java │ │ │ │ ├── TransactionsDTO.java │ │ │ │ ├── UpdateGroupTransactionDTO.java │ │ │ │ └── UpdatePersonTransactionDTO.java │ │ │ └── dtosAssemblers │ │ │ │ ├── AccountDTOAssembler.java │ │ │ │ ├── AccountsDTOAssembler.java │ │ │ │ ├── AddPersonToGroupDTOAssembler.java │ │ │ │ ├── BooleanDTOAssembler.java │ │ │ │ ├── CategoriesDTOAssembler.java │ │ │ │ ├── CheckIfSiblingsDTOAssembler.java │ │ │ │ ├── CreateGroupAccountDTOAssembler.java │ │ │ │ ├── CreateGroupCategoryDTOAssembler.java │ │ │ │ ├── CreateGroupDTOAssembler.java │ │ │ │ ├── CreateGroupTransactionDTOAssembler.java │ │ │ │ ├── CreatePersonAccountDTOAssembler.java │ │ │ │ ├── CreatePersonCategoryDTOAssembler.java │ │ │ │ ├── CreatePersonDTOAssembler.java │ │ │ │ ├── CreatePersonTransactionDTOAssembler.java │ │ │ │ ├── DeleteGroupTransactionDTOAssembler.java │ │ │ │ ├── DeletePersonTransactionDTOAssembler.java │ │ │ │ ├── GroupAdminsDTOAssembler.java │ │ │ │ ├── GroupAllMembersDTOAssembler.java │ │ │ │ ├── GroupDTOAssembler.java │ │ │ │ ├── GroupIDDTOAssembler.java │ │ │ │ ├── GroupListDTOAssembler.java │ │ │ │ ├── GroupMemberClearanceDTOAssembler.java │ │ │ │ ├── GroupMembersDTOAssembler.java │ │ │ │ ├── GroupSearchAccountRecordsInDTOAssembler.java │ │ │ │ ├── GroupTransactionsWithinPeriodDTOinAssembler.java │ │ │ │ ├── GroupTransactionsWithinPeriodDTOoutAssembler.java │ │ │ │ ├── GroupsThatAreFamilyDTOAssembler.java │ │ │ │ ├── PersonDTOAssembler.java │ │ │ │ ├── PersonEmailDTOAssembler.java │ │ │ │ ├── PersonSearchAccountRecordsInDTOAssembler.java │ │ │ │ ├── SearchAccountRecordsOutDTOAssembler.java │ │ │ │ ├── SiblingsDTOAssembler.java │ │ │ │ ├── TransactionDTOoutAssembler.java │ │ │ │ ├── TransactionsDTOAssembler.java │ │ │ │ ├── UpdateGroupTransactionDTOAssembler.java │ │ │ │ └── UpdatePersonTransactionDTOAssembler.java │ │ │ ├── infrastructureLayer │ │ │ ├── infrastructureLayer_here.txt │ │ │ └── repositories │ │ │ │ ├── AccountRepository.java │ │ │ │ ├── CategoryRepository.java │ │ │ │ ├── GroupRepository.java │ │ │ │ ├── LedgerRepository.java │ │ │ │ ├── PersonRepository.java │ │ │ │ └── ScheduleRepository.java │ │ │ └── persistenceLayer │ │ │ ├── jpa_repos_here.txt │ │ │ └── repositoriesJPA │ │ │ ├── AccountJpaRepository.java │ │ │ ├── AddressJpaRepository.java │ │ │ ├── AdminJpaRepository.java │ │ │ ├── CategoryJpaRepository.java │ │ │ ├── GroupJpaRepository.java │ │ │ ├── LedgerJpaRepository.java │ │ │ ├── MemberJpaRepository.java │ │ │ ├── PersonJpaRepository.java │ │ │ ├── SiblingJpaRepository.java │ │ │ └── TransactionJpaRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── finance │ └── project │ ├── TestConfiguration.java │ ├── applicationLayer │ ├── applicationServices │ │ ├── groupServices │ │ │ ├── AddPersonToGroupServiceTest.java │ │ │ ├── CreateGroupAccountServiceTest.java │ │ │ ├── CreateGroupCategoryServiceTest.java │ │ │ ├── CreateGroupServiceTest.java │ │ │ ├── CreateGroupTransactionServiceTest.java │ │ │ ├── GroupSearchAccountRecordsServiceTest.java │ │ │ └── GroupTransactionsWithinPeriodServiceTest.java │ │ ├── otherServices │ │ │ ├── CheckGroupsFamilyServiceTest.java │ │ │ └── CheckSiblingsServiceTest.java │ │ └── personServices │ │ │ ├── CreatePersonAccountServiceTest.java │ │ │ ├── CreatePersonCategoryServiceTest.java │ │ │ ├── CreatePersonServiceTest.java │ │ │ ├── CreatePersonTransactionServiceTest.java │ │ │ └── PersonSearchAccountRecordsServiceTest.java │ └── services_here.txt │ ├── controllerLayer │ ├── integrationTests │ │ ├── AbstractTest.java │ │ ├── AddPersonToGroupControllerTest.java │ │ ├── CheckGroupsFamilyControllerTest.java │ │ ├── CheckSiblingsControllerTest.java │ │ ├── CreateGroupAccountControllerTest.java │ │ ├── CreateGroupCategoryControllerTest.java │ │ ├── CreateGroupControllerTest.java │ │ ├── CreateGroupTransactionControllerTest.java │ │ ├── CreatePersonAccountControllerTest.java │ │ ├── CreatePersonCategoryControllerTest.java │ │ ├── CreatePersonControllerTest.java │ │ ├── CreatePersonTransactionControllerTest.java │ │ ├── GroupSearchAccountRecordsControllerIntegrationTest.java │ │ └── PersonAccountRecordsControllerIntegrationTest.java │ └── unitTests │ │ ├── AddPersonToGroupControllerRESTTest.java │ │ ├── CheckGroupsFamilyControllerRESTTest.java │ │ ├── CheckSiblingsControllerRESTTest.java │ │ ├── CreateGroupAccountControllerRESTTest.java │ │ ├── CreateGroupCategoryControllerRESTTest.java │ │ ├── CreateGroupControllerRESTTest.java │ │ ├── CreateGroupTransactionControllerRESTTest.java │ │ ├── CreatePersonAccountControllerRestTest.java │ │ ├── CreatePersonCategoryControllerRESTTest.java │ │ ├── CreatePersonControllerRESTTest.java │ │ ├── CreatePersonTransactionControllerRESTTest.java │ │ ├── GroupSearchAccountRecordsControllerRESTTest.java │ │ ├── PersonSearchAccountRecordsControllerRESTTest.java │ │ └── errorHandling │ │ └── ApiErrorTest.java │ ├── dataModel │ ├── dataAssemblers │ │ ├── AccountDomainDataAssemblerTest.java │ │ ├── CategoryDomainDataAssemblerTest.java │ │ └── GroupDomainDataAssemblerTest.java │ └── dataModel │ │ ├── AbstractIdJpaTest.java │ │ ├── AccountJpaTest.java │ │ ├── AddressJpaTest.java │ │ ├── AdminJpaTest.java │ │ ├── CategoryJpaTest.java │ │ ├── GroupJpaTest.java │ │ ├── LedgerJpaTest.java │ │ ├── MemberJpaTest.java │ │ ├── PersonJpaTest.java │ │ ├── SiblingJpaTest.java │ │ └── TransactionJpaTest.java │ ├── domainLayer │ ├── domainEntities │ │ ├── aggregates │ │ │ ├── account │ │ │ │ └── AccountTest.java │ │ │ ├── category │ │ │ │ └── CategoryTest.java │ │ │ ├── group │ │ │ │ └── GroupTest.java │ │ │ ├── ledger │ │ │ │ ├── LedgerTest.java │ │ │ │ └── TransactionTest.java │ │ │ ├── person │ │ │ │ ├── AddressTest.java │ │ │ │ ├── BirthdateTest.java │ │ │ │ ├── BirthplaceTest.java │ │ │ │ ├── NameTest.java │ │ │ │ └── PersonTest.java │ │ │ └── scheduling │ │ │ │ ├── PeriodicityTest.java │ │ │ │ ├── SchedulingTest.java │ │ │ │ └── TriggerDateTest.java │ │ └── vosShared │ │ │ ├── AccountIDTest.java │ │ │ ├── AmountTest.java │ │ │ ├── CategoryIDTest.java │ │ │ ├── DateOfCreationTest.java │ │ │ ├── DateTest.java │ │ │ ├── DenominationTest.java │ │ │ ├── DescriptionTest.java │ │ │ ├── EmailTest.java │ │ │ ├── GroupIDTest.java │ │ │ ├── LedgerIDTest.java │ │ │ ├── PersonIDTest.java │ │ │ ├── ScheduleIDTest.java │ │ │ ├── TransactionTypeTest.java │ │ │ └── TypeTest.java │ └── repositoriesInterfaces │ │ └── repositories_Interfaces_here.txt │ ├── dtos │ ├── dtos │ │ ├── AccountDTOTest.java │ │ ├── AccountsDTOTest.java │ │ ├── AddPersonToGroupDTOTest.java │ │ ├── BooleanDTOTest.java │ │ ├── CategoriesDTOTest.java │ │ ├── CheckIfSiblingsDTOTest.java │ │ ├── CreateGroupAccountDTOTest.java │ │ ├── CreateGroupCategoryDTOTest.java │ │ ├── CreateGroupDTOTest.java │ │ ├── CreateGroupTransactionDTOTest.java │ │ ├── CreatePersonAccountDTOTest.java │ │ ├── CreatePersonCategoryDTOTest.java │ │ ├── CreatePersonDTOTest.java │ │ ├── CreatePersonTransactionDTOTest.java │ │ ├── DeleteGroupTransactionDTOTest.java │ │ ├── DeletePersonTransactionDTOTest.java │ │ ├── GroupAdminsDTOTest.java │ │ ├── GroupDTOTest.java │ │ ├── GroupIDDTOTest.java │ │ ├── GroupMembersDTOTest.java │ │ ├── GroupSearchAccountRecordsInDTOTest.java │ │ ├── GroupTransactionsWithinPeriodDTOinTest.java │ │ ├── GroupTransactionsWithinPeriodDTOoutTest.java │ │ ├── GroupsThatAreFamilyDTOTest.java │ │ ├── NewAccountPersonInfoDTOTest.java │ │ ├── NewAddPersonToGroupInfoDTOTest.java │ │ ├── NewCreateGroupInfoDTOTest.java │ │ ├── NewCreatePersonInfoDTOTest.java │ │ ├── NewGroupAccountInfoDTOTest.java │ │ ├── NewGroupCategoryInfoDTOTest.java │ │ ├── NewGroupTransactionInfoDTOTest.java │ │ ├── NewPersonCategoryInfoDTOTest.java │ │ ├── NewPersonTransactionInfoDTOTest.java │ │ ├── PersonDTOTest.java │ │ ├── PersonEmailDTOTest.java │ │ ├── PersonIDDTOTest.java │ │ ├── PersonSearchAccountRecordsInDTOTest.java │ │ ├── PersonSearchAccountRecordsOutDTOTest.java │ │ ├── PrepareInfoToCheckIfSiblingsDTOTest.java │ │ ├── SiblingsDTOTest.java │ │ ├── TransactionDTOoutTest.java │ │ ├── TransactionsDTOTest.java │ │ ├── UpdateGroupTransactionDTOTest.java │ │ └── UpdatePersonTransactionDTOTest.java │ └── dtosAssemblers │ │ ├── AccountDTOAssemblerTest.java │ │ ├── AccountsDTOAssemblerTest.java │ │ ├── AddPersonToGroupDTOAssemblerTest.java │ │ ├── BooleanDTOAssemblerTest.java │ │ ├── CategoriesDTOAssemblerTest.java │ │ ├── CheckIfSiblingsDTOAssemblerTest.java │ │ ├── CreateGroupAccountDTOAssemblerTest.java │ │ ├── CreateGroupCategoryDTOAssemblerTest.java │ │ ├── CreateGroupDTOAssemblerTest.java │ │ ├── CreateGroupTransactionDTOAssemblerTest.java │ │ ├── CreatePersonAccountDTOAssemblerTest.java │ │ ├── CreatePersonCategoryDTOAssemblerTest.java │ │ ├── CreatePersonDTOAssemblerTest.java │ │ ├── CreatePersonTransactionDTOAssemblerTest.java │ │ ├── DeleteGroupTransactionDTOAssemblerTest.java │ │ ├── DeletePersonTransactionDTOAssemblerTest.java │ │ ├── GroupAdminsDTOAssemblerTest.java │ │ ├── GroupDTOAssemblerTest.java │ │ ├── GroupIDDTOAssemblerTest.java │ │ ├── GroupMembersDTOAssemblerTest.java │ │ ├── GroupSearchAccountRecordsInDTOAssemblerTest.java │ │ ├── GroupTransactionsWithinPeriodDTOinAssemblerTest.java │ │ ├── GroupTransactionsWithinPeriodDTOoutAssemblerTest.java │ │ ├── GroupsThatAreFamilyDTOAssemblerTest.java │ │ ├── PersonDTOAssemblerTest.java │ │ ├── PersonEmailDTOAssemblerTest.java │ │ ├── PersonSearchAccountRecordsInDTOAssemblerTest.java │ │ ├── PersonSearchAccountRecordsOutDTOAssemblerTest.java │ │ ├── SiblingsDTOAssemblerTest.java │ │ ├── TransactionDTOoutAssemblerTest.java │ │ ├── TransactionsDTOAssemblerTest.java │ │ ├── UpdateGroupTransactionDTOAssemblerTest.java │ │ └── UpdatePersonTransactionDTOAssemblerTest.java │ └── infrastructureLayer │ ├── infrastructureLayer_here.txt │ └── repositories │ ├── AccountRepositoryTest.java │ ├── CategoryRepositoryTest.java │ ├── GroupRepositoryTest.java │ ├── LedgerRepositoryTest.java │ ├── PersonRepositoryTest.java │ └── ScheduleRepositoryTest.java ├── diagrams ├── CD_add_Account.png ├── DDD.png ├── DM.png ├── FURPS.png ├── GOF.png ├── GRASP.png ├── SDP.png ├── SD_add_Account_1.png ├── SD_add_Account_2.png ├── SD_add_Account_3.png ├── SOLID.png ├── STUPID.png ├── analysis.png ├── arch_styles.png ├── architecture.png ├── both.png ├── c4.png ├── categories.png ├── combined.jpeg ├── ddd_concepts.png ├── earlyEarlySD.png ├── earlySD.png ├── groupsH2.png ├── home.png ├── layers.png ├── login.png ├── personsH2.png ├── uml │ ├── aggregation.png │ ├── association.png │ ├── composition.png │ ├── dependency.png │ ├── encapsulation.png │ ├── inheritance.png │ └── polymorphism.png └── viewModel.png ├── finance.iml ├── package-lock.json ├── package.json ├── pom.xml ├── public ├── favicon.ico ├── index.html ├── logo192.png ├── logo512.png ├── manifest.json └── robots.txt └── src ├── App.css ├── App.js ├── App.test.js ├── context ├── Actions.js ├── AppContext.js ├── AppProvider.js └── Reducer.js ├── entities ├── accounts │ ├── AccountForm.js │ └── EntityAccount.js ├── categories │ ├── CategoryForm.js │ ├── EntityCategory.js │ └── GroupCategories.js ├── groups │ ├── EntityGroup.js │ ├── GroupForm.js │ └── Members │ │ ├── EntityMembers.js │ │ └── MembersForm.js ├── ledgers │ ├── EntityLedgers.js │ ├── LedgerForm.js │ ├── LedgerGroup.js │ ├── TransactionsAccountSelect.js │ └── TransactionsGroupAccountSelect.js └── members │ └── Members.js ├── index.css ├── index.js ├── links ├── Accounts.js ├── AdminsGroup.js ├── Categories.js ├── GroupId.js ├── Home.js ├── Ledger.js ├── Login.js ├── Logout.js ├── MembersGroup.js ├── MyGroups.js ├── Mypage.js ├── NoRoute.js └── PrivateRoute.js ├── logo.svg ├── serviceWorker.js ├── setupTests.js ├── tables ├── AccountsTable │ ├── AccountsTable.js │ ├── TableBody.js │ └── TableHeader.js ├── CategoriesTable │ ├── CategoriesTable.js │ ├── CategoriesTableBody.js │ └── CategoriesTableHeader.js ├── GroupsTable │ ├── GroupsTable.js │ ├── TableBody.js │ └── TableHeader.js ├── LedgersTable │ ├── LedgerTable.js │ ├── LedgerTableBody.js │ └── LedgerTableHeader.js ├── MembersTable │ ├── MembersTable.js │ ├── MembersTableBody.js │ └── MembersTableHeader.js └── User │ └── User.js └── yarn.lock /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | training 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.m2e.core.maven2Nature 22 | 23 | 24 | -------------------------------------------------------------------------------- /HELP.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ### Reference Documentation 4 | For further reference, please consider the following sections: 5 | 6 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) 7 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/maven-plugin/reference/html/) 8 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/maven-plugin/reference/html/#build-image) 9 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/reference/htmlsingle/#boot-features-developing-web-applications) 10 | * [Spring Data JPA](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/reference/htmlsingle/#boot-features-jpa-and-spring-data) 11 | 12 | ### Guides 13 | The following guides illustrate how to use some features concretely: 14 | 15 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) 16 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) 17 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) 18 | * [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/) 19 | 20 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/ProjectApplication.java: -------------------------------------------------------------------------------- 1 | package com.finance.project; 2 | 3 | import com.finance.project.applicationLayer.applicationServices.personServices.CreatePersonService; 4 | import com.finance.project.applicationLayer.applicationServices.groupServices.CreateGroupService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.boot.ApplicationArguments; 7 | import org.springframework.boot.ApplicationRunner; 8 | import org.springframework.boot.SpringApplication; 9 | import org.springframework.boot.autoconfigure.SpringBootApplication; 10 | import org.springframework.context.annotation.Bean; 11 | import org.springframework.web.bind.annotation.RestController; 12 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 13 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 14 | 15 | 16 | @SpringBootApplication 17 | @RestController 18 | public class ProjectApplication implements ApplicationRunner { 19 | 20 | @Autowired 21 | CreatePersonService createPersonService; 22 | @Autowired 23 | CreateGroupService createGroupService; 24 | 25 | public static void main(String[] args) { 26 | SpringApplication.run(ProjectApplication.class, args); 27 | } 28 | 29 | 30 | @Override 31 | public void run(ApplicationArguments arg0) throws Exception { 32 | System.out.println("Initializing Database"); 33 | Bootstrapping.loadData(createPersonService, createGroupService); 34 | System.out.println("Database Created"); 35 | } 36 | 37 | @Bean 38 | public WebMvcConfigurer corsConfigurer() { 39 | return new WebMvcConfigurer() { 40 | @Override 41 | public void addCorsMappings(CorsRegistry registry) { 42 | registry.addMapping("/**").allowedOrigins("http://localhost:3000") 43 | .allowedMethods("HEAD", "GET", "PUT", "POST", "DELETE", "PATCH"); 44 | } 45 | }; 46 | } 47 | 48 | 49 | } 50 | 51 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/applicationLayer/services_here.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/backend/src/main/java/com/finance/project/applicationLayer/services_here.txt -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/controllerLayer/controllers.here.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/backend/src/main/java/com/finance/project/controllerLayer/controllers.here.txt -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/controllerLayer/controllersREST/errorHandling/ApiError.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.controllerLayer.controllersREST.errorHandling; 2 | 3 | import org.springframework.http.HttpStatus; 4 | 5 | import java.util.Arrays; 6 | import java.util.List; 7 | import java.util.Objects; 8 | 9 | public class ApiError { 10 | 11 | // status: the HTTP status code 12 | // message: the error message associated with exception 13 | //error: List of constructed error messages 14 | 15 | private HttpStatus status; 16 | private String message; 17 | private List errors; 18 | 19 | public ApiError(HttpStatus status, String message, List errors) { 20 | super(); 21 | this.status = status; 22 | this.message = message; 23 | this.errors = errors; 24 | } 25 | 26 | public ApiError(HttpStatus status, String message, String error) { 27 | super(); 28 | this.status = status; 29 | this.message = message; 30 | errors = Arrays.asList(error); 31 | } 32 | 33 | public HttpStatus getStatus() { 34 | return status; 35 | } 36 | 37 | public void setStatus(HttpStatus status) { 38 | this.status = status; 39 | } 40 | 41 | public String getMessage() { 42 | return message; 43 | } 44 | 45 | public void setMessage(String message) { 46 | this.message = message; 47 | } 48 | 49 | public List getErrors() { 50 | return errors; 51 | } 52 | 53 | public void setErrors(List errors) { 54 | this.errors = errors; 55 | } 56 | 57 | @Override 58 | public boolean equals(Object o) { 59 | if (this == o) return true; 60 | if (o == null || getClass() != o.getClass()) return false; 61 | ApiError apiError = (ApiError) o; 62 | return getStatus() == apiError.getStatus() && 63 | Objects.equals(getMessage(), apiError.getMessage()) && 64 | Objects.equals(getErrors(), apiError.getErrors()); 65 | } 66 | 67 | @Override 68 | public int hashCode() { 69 | return Objects.hash(getStatus(), getMessage(), getErrors()); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dataModel/dataAssemblers/AccountDomainDataAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dataModel.dataAssemblers; 2 | 3 | import com.finance.project.domainLayer.entitiesInterfaces.OwnerID; 4 | import org.springframework.stereotype.Service; 5 | import com.finance.project.domainLayer.domainEntities.aggregates.account.Account; 6 | import com.finance.project.domainLayer.domainEntities.vosShared.GroupID; 7 | import com.finance.project.domainLayer.domainEntities.vosShared.PersonID; 8 | import com.finance.project.dataModel.dataModel.AccountJpa; 9 | 10 | @Service 11 | public class AccountDomainDataAssembler { 12 | 13 | public AccountJpa toData(Account account) { 14 | 15 | String id = ""; 16 | 17 | if (account.getAccountID().getOwnerID() instanceof PersonID) { 18 | PersonID personID = (PersonID) account.getAccountID().getOwnerID(); 19 | id = personID.getEmail().getEmail(); 20 | } 21 | 22 | if (account.getAccountID().getOwnerID() instanceof GroupID) { 23 | GroupID groupID = (GroupID) account.getAccountID().getOwnerID(); 24 | id = groupID.getDenomination().getDenomination(); 25 | } 26 | 27 | AccountJpa accountJpa = new AccountJpa(id, account.getAccountID().getDenomination().getDenomination(), account.getDescription().getDescription()); 28 | 29 | return accountJpa; 30 | } 31 | 32 | public Account toDomain(AccountJpa accountJpa) { 33 | 34 | OwnerID ownerID; 35 | 36 | if (accountJpa.getId().getOwnerID().contains("@")) { 37 | ownerID = PersonID.createPersonID(accountJpa.getId().getOwnerID()); 38 | } else { 39 | ownerID = GroupID.createGroupID(accountJpa.getId().getOwnerID()); 40 | } 41 | 42 | Account account = Account.createAccount(accountJpa.getDescription(), accountJpa.getId().getDenomination(), ownerID); 43 | 44 | return account; 45 | } 46 | } -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dataModel/dataAssemblers/CategoryDomainDataAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dataModel.dataAssemblers; 2 | 3 | import com.finance.project.domainLayer.entitiesInterfaces.OwnerID; 4 | import org.springframework.stereotype.Service; 5 | import com.finance.project.domainLayer.domainEntities.aggregates.category.Category; 6 | import com.finance.project.domainLayer.domainEntities.vosShared.GroupID; 7 | import com.finance.project.domainLayer.domainEntities.vosShared.PersonID; 8 | import com.finance.project.dataModel.dataModel.CategoryJpa; 9 | 10 | @Service 11 | public class CategoryDomainDataAssembler { 12 | 13 | public CategoryJpa toData(Category category) { 14 | 15 | String id = ""; 16 | 17 | if (category.getCategoryID().getOwnerID() instanceof PersonID) { 18 | PersonID personID = (PersonID) category.getCategoryID().getOwnerID(); 19 | id = personID.getEmail().getEmail(); 20 | } 21 | 22 | if (category.getCategoryID().getOwnerID() instanceof GroupID) { 23 | GroupID groupID = (GroupID) category.getCategoryID().getOwnerID(); 24 | id = groupID.getDenomination().getDenomination(); 25 | } 26 | 27 | CategoryJpa categoryJpa = new CategoryJpa(id, category.getCategoryID().getDenomination().getDenomination()); 28 | 29 | return categoryJpa; 30 | } 31 | 32 | public Category toDomain(CategoryJpa categoryJpa) { 33 | 34 | OwnerID ownerID; 35 | 36 | if (categoryJpa.getId().getOwnerID().contains("@")) { 37 | ownerID = PersonID.createPersonID(categoryJpa.getId().getOwnerID()); 38 | } else { 39 | ownerID = GroupID.createGroupID(categoryJpa.getId().getOwnerID()); 40 | } 41 | 42 | Category category = Category.createCategory(categoryJpa.getId().getDenomination(), ownerID); 43 | 44 | return category; 45 | } 46 | } -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dataModel/dataModel/AbstractIdJpa.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dataModel.dataModel; 2 | 3 | import javax.persistence.Embeddable; 4 | import java.io.Serializable; 5 | import java.util.Objects; 6 | 7 | @Embeddable 8 | public class AbstractIdJpa implements Serializable { 9 | 10 | private String ownerID; 11 | private String denomination; 12 | 13 | public AbstractIdJpa(String ownerID, String denomination) { 14 | this.ownerID = ownerID; 15 | this.denomination = denomination; 16 | } 17 | 18 | public AbstractIdJpa() { 19 | } 20 | 21 | public String getOwnerID() { 22 | return ownerID; 23 | } 24 | 25 | public void setOwnerID(String ownerID) { 26 | this.ownerID = ownerID; 27 | } 28 | 29 | public String getDenomination() { 30 | return denomination; 31 | } 32 | 33 | public void setDenomination(String denomination) { 34 | this.denomination = denomination; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | return "AbstractIdJpa{" + 40 | "ownerID='" + ownerID + '\'' + 41 | ", denomination='" + denomination + '\'' + 42 | '}'; 43 | } 44 | 45 | @Override 46 | public boolean equals(Object o) { 47 | if (this == o) return true; 48 | if (o == null || getClass() != o.getClass()) return false; 49 | AbstractIdJpa that = (AbstractIdJpa) o; 50 | return Objects.equals(ownerID, that.ownerID) && 51 | Objects.equals(denomination, that.denomination); 52 | } 53 | 54 | @Override 55 | public int hashCode() { 56 | return Objects.hash(ownerID, denomination); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dataModel/dataModel/AccountJpa.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dataModel.dataModel; 2 | 3 | import javax.persistence.EmbeddedId; 4 | import javax.persistence.Entity; 5 | import javax.persistence.Table; 6 | import java.io.Serializable; 7 | import java.util.Objects; 8 | 9 | @Entity 10 | @Table(name = "accounts") 11 | public class AccountJpa implements Serializable { 12 | 13 | @EmbeddedId 14 | private AbstractIdJpa id; 15 | 16 | private String description; 17 | 18 | public AccountJpa() { 19 | } 20 | 21 | public AccountJpa(String ownerID, String denomination, String description) { 22 | this.id = new AbstractIdJpa(ownerID, denomination); 23 | this.description = description; 24 | } 25 | 26 | public AbstractIdJpa getId() { 27 | return id; 28 | } 29 | 30 | public void setId(AbstractIdJpa id) { 31 | this.id = id; 32 | } 33 | 34 | public String getDescription() { 35 | return description; 36 | } 37 | 38 | public void setDescription(String description) { 39 | this.description = description; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return "AccountJpa{" + 45 | "id=" + id + 46 | ", description='" + description + '\'' + 47 | '}'; 48 | } 49 | 50 | @Override 51 | public boolean equals(Object o) { 52 | if (this == o) return true; 53 | if (o == null || getClass() != o.getClass()) return false; 54 | AccountJpa that = (AccountJpa) o; 55 | return Objects.equals(id, that.id); 56 | } 57 | 58 | @Override 59 | public int hashCode() { 60 | return Objects.hash(id); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dataModel/dataModel/CategoryJpa.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dataModel.dataModel; 2 | 3 | import javax.persistence.EmbeddedId; 4 | import javax.persistence.Entity; 5 | import javax.persistence.Table; 6 | import java.io.Serializable; 7 | import java.util.Objects; 8 | 9 | 10 | @Entity 11 | @Table(name="categories") 12 | public class CategoryJpa implements Serializable { 13 | 14 | @EmbeddedId 15 | private AbstractIdJpa id; 16 | 17 | public CategoryJpa() { 18 | } 19 | 20 | public CategoryJpa(String ownerID, String denomination) { 21 | this.id = new AbstractIdJpa(ownerID,denomination); 22 | } 23 | 24 | public AbstractIdJpa getId() { 25 | return id; 26 | } 27 | 28 | public void setId(AbstractIdJpa id) { 29 | this.id = id; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "CategoryJpa{" + 35 | "id=" + id + 36 | '}'; 37 | } 38 | 39 | @Override 40 | public boolean equals(Object o) { 41 | if (this == o) return true; 42 | if (o == null || getClass() != o.getClass()) return false; 43 | CategoryJpa that = (CategoryJpa) o; 44 | return Objects.equals(id, that.id); 45 | } 46 | 47 | @Override 48 | public int hashCode() { 49 | return Objects.hash(id); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dataModel/dataModel/LedgerJpa.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dataModel.dataModel; 2 | 3 | import org.hibernate.annotations.Fetch; 4 | import com.finance.project.domainLayer.domainEntities.vosShared.LedgerID; 5 | 6 | import javax.persistence.*; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import java.util.Objects; 10 | 11 | @Entity 12 | @Table(name = "ledgers") 13 | public class LedgerJpa { 14 | 15 | @EmbeddedId 16 | private LedgerID id; 17 | 18 | @OneToMany(mappedBy = "ledger", cascade = CascadeType.ALL, orphanRemoval = true) 19 | @Fetch(org.hibernate.annotations.FetchMode.SUBSELECT) 20 | List transactions; 21 | 22 | // CONSTRUCTOR 23 | 24 | 25 | public LedgerJpa() { 26 | } 27 | 28 | public LedgerJpa(String id) { 29 | this.id = new LedgerID(id); 30 | this.transactions = new ArrayList<>(); 31 | } 32 | 33 | public LedgerJpa(LedgerID ledgerID){ 34 | this.id = ledgerID; 35 | this.transactions = new ArrayList<>(); 36 | } 37 | 38 | 39 | // GETTERS AND SETTERS 40 | 41 | 42 | public LedgerID getId() { 43 | return id; 44 | } 45 | 46 | public void setId(LedgerID id) { 47 | this.id = id; 48 | } 49 | 50 | public List getTransactions() { 51 | return transactions; 52 | } 53 | 54 | public void setTransactions(List transactions) { 55 | this.transactions = transactions; 56 | } 57 | 58 | // TO STRING 59 | 60 | public String toString() { 61 | return "Ledger {" + 62 | "id='" + id.toString() + '\'' + 63 | '}'; 64 | } 65 | 66 | // EQUALS AND HASHCODE 67 | 68 | 69 | @Override 70 | public boolean equals(Object o) { 71 | if (this == o) return true; 72 | if (o == null || getClass() != o.getClass()) return false; 73 | LedgerJpa ledgerJpa = (LedgerJpa) o; 74 | return Objects.equals(id, ledgerJpa.id); 75 | } 76 | 77 | @Override 78 | public int hashCode() { 79 | return Objects.hash(id); 80 | } 81 | } 82 | 83 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/domainEntities/aggregates/category/Category.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.domainEntities.aggregates.category; 2 | 3 | import com.finance.project.domainLayer.domainEntities.vosShared.CategoryID; 4 | import com.finance.project.domainLayer.entitiesInterfaces.Entity; 5 | import com.finance.project.domainLayer.entitiesInterfaces.OwnerID; 6 | 7 | import java.util.Objects; 8 | 9 | 10 | public class Category implements Entity { 11 | 12 | private final CategoryID categoryID; 13 | 14 | // Constructor 15 | 16 | public static Category createCategory(String denomination, OwnerID ownerID) { 17 | return new Category(denomination, ownerID); 18 | } 19 | 20 | private Category(String denomination, OwnerID ownerID) { 21 | if (denomination == null || denomination.equals("")) { 22 | throw new IllegalArgumentException("Category not created due to the fact that the denomination parameter hasn't a valid argument"); 23 | } else if (ownerID == null) { 24 | throw new IllegalArgumentException("Category not created due to the fact that the ownerID parameter hasn't a valid argument"); 25 | } 26 | this.categoryID = CategoryID.createCategoryID(denomination, ownerID); 27 | } 28 | 29 | 30 | // Getters 31 | 32 | public CategoryID getCategoryID() { 33 | return categoryID; 34 | } 35 | 36 | 37 | // Equals & hashCode 38 | 39 | @Override 40 | public boolean equals(Object o) { 41 | if (this == o) return true; 42 | if (!(o instanceof Category)) return false; 43 | Category category = (Category) o; 44 | 45 | if (!this.categoryID.equals(category.categoryID)) { 46 | return false; 47 | } 48 | return true; 49 | } 50 | 51 | @Override 52 | public int hashCode() { 53 | return Objects.hash(categoryID); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/domainEntities/aggregates/person/Birthdate.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.domainEntities.aggregates.person; 2 | 3 | import com.finance.project.domainLayer.entitiesInterfaces.ValueObject; 4 | 5 | import java.time.LocalDate; 6 | import java.util.Objects; 7 | 8 | 9 | public class Birthdate implements ValueObject { 10 | 11 | private LocalDate birthdate; 12 | 13 | // Constructor 14 | 15 | public static Birthdate createBirthdate(LocalDate birthdate) { 16 | return new Birthdate(birthdate); 17 | } 18 | 19 | private Birthdate(LocalDate birthdate) { 20 | if (birthdate == null) { 21 | throw new IllegalArgumentException("Birthdate not created due to the fact that the birthdate parameter hasn't a valid argument"); 22 | } 23 | this.birthdate = birthdate; 24 | } 25 | 26 | // Getters 27 | 28 | public LocalDate getBirthdate() { 29 | return birthdate; 30 | } 31 | 32 | 33 | // Equals & hashCode 34 | 35 | @Override 36 | public boolean equals(Object o) { 37 | if (this == o) return true; 38 | if (o == null || getClass() != o.getClass()) return false; 39 | Birthdate birthdate1 = (Birthdate) o; 40 | return Objects.equals(birthdate, birthdate1.birthdate); 41 | } 42 | 43 | @Override 44 | public int hashCode() { 45 | return Objects.hash(birthdate); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/domainEntities/aggregates/person/Birthplace.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.domainEntities.aggregates.person; 2 | 3 | import com.finance.project.domainLayer.entitiesInterfaces.ValueObject; 4 | 5 | import java.util.Objects; 6 | 7 | 8 | public class Birthplace implements ValueObject { 9 | 10 | private String birthplace; 11 | 12 | // Constructor 13 | 14 | public static Birthplace createBirthplace(String birthplace){ 15 | return new Birthplace(birthplace); 16 | } 17 | 18 | private Birthplace (String birthplace) { 19 | if (birthplace == null) { 20 | throw new IllegalArgumentException("Birthplace not created due to the fact that the birthplace parameter hasn't a valid argument"); 21 | } 22 | this.birthplace = birthplace; 23 | } 24 | 25 | // Getters 26 | 27 | public String getBirthplace() { 28 | return birthplace; 29 | } 30 | 31 | // Equals 32 | 33 | @Override 34 | public boolean equals(Object o) { 35 | if (this == o) return true; 36 | if (o == null || getClass() != o.getClass()) return false; 37 | Birthplace that = (Birthplace) o; 38 | return Objects.equals(birthplace.toUpperCase(), that.birthplace.toUpperCase()); 39 | } 40 | 41 | // hashCode 42 | 43 | @Override 44 | public int hashCode() { 45 | return Objects.hash(birthplace); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/domainEntities/aggregates/person/Name.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.domainEntities.aggregates.person; 2 | 3 | import com.finance.project.domainLayer.entitiesInterfaces.ValueObject; 4 | 5 | import java.util.Objects; 6 | 7 | 8 | public class Name implements ValueObject { 9 | 10 | private String name; 11 | 12 | // Constructor 13 | 14 | public static Name createName(String name){ 15 | return new Name(name); 16 | } 17 | 18 | private Name(String name) { 19 | if (name == null || name.equals("")) { 20 | throw new IllegalArgumentException("Name not created due to the fact that the name parameter hasn't a valid argument"); 21 | } else { 22 | this.name = name; 23 | } 24 | } 25 | 26 | // Getters 27 | 28 | public String getName() { 29 | return name; 30 | } 31 | 32 | 33 | // Equals & hashCode 34 | 35 | @Override 36 | public boolean equals(Object o) { 37 | if (this == o) return true; 38 | if (o == null || getClass() != o.getClass()) return false; 39 | Name name1 = (Name) o; 40 | return Objects.equals(name.toUpperCase(), name1.name.toUpperCase()); 41 | } 42 | 43 | @Override 44 | public int hashCode() { 45 | return Objects.hash(name); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/domainEntities/aggregates/scheduling/Periodicity.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.domainEntities.aggregates.scheduling; 2 | 3 | import com.finance.project.domainLayer.entitiesInterfaces.ValueObject; 4 | 5 | import java.util.Objects; 6 | 7 | 8 | public class Periodicity implements ValueObject { 9 | 10 | private String periodicity; 11 | 12 | // Constructor 13 | 14 | public static Periodicity createPeriodicity(String periodicity){ 15 | return new Periodicity(periodicity); 16 | } 17 | 18 | private Periodicity (String periodicity) { 19 | this.periodicity= periodicity; 20 | } 21 | 22 | 23 | // Getters 24 | 25 | public String getPeriodicity() { 26 | return periodicity; 27 | } 28 | 29 | 30 | // Equals & hashCode 31 | 32 | @Override 33 | public boolean equals(Object o) { 34 | if (this == o) return true; 35 | if (o == null || getClass() != o.getClass()) return false; 36 | Periodicity that = (Periodicity) o; 37 | return Objects.equals(periodicity, that.periodicity); 38 | } 39 | 40 | 41 | @Override 42 | public int hashCode() { 43 | return Objects.hash(periodicity); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/domainEntities/aggregates/scheduling/TriggerDate.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.domainEntities.aggregates.scheduling; 2 | 3 | import com.finance.project.domainLayer.entitiesInterfaces.ValueObject; 4 | 5 | import java.time.LocalDate; 6 | import java.util.Objects; 7 | 8 | 9 | public class TriggerDate implements ValueObject { 10 | 11 | private LocalDate triggerDate; 12 | 13 | // Constructor 14 | 15 | public static TriggerDate createTriggerDate(LocalDate triggerDate) { 16 | return new TriggerDate(triggerDate); 17 | } 18 | 19 | private TriggerDate(LocalDate triggerDate) { 20 | this.triggerDate = triggerDate; 21 | } 22 | 23 | // Getters 24 | 25 | public LocalDate getTriggerDate() { 26 | return triggerDate; 27 | } 28 | 29 | // Equals & hashCode 30 | 31 | @Override 32 | public boolean equals(Object o) { 33 | if (this == o) return true; 34 | if (o == null || getClass() != o.getClass()) return false; 35 | TriggerDate that = (TriggerDate) o; 36 | return Objects.equals(triggerDate, that.triggerDate); 37 | } 38 | 39 | 40 | @Override 41 | public int hashCode() { 42 | return Objects.hash(triggerDate); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/domainEntities/vosShared/Amount.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.domainEntities.vosShared; 2 | 3 | import com.finance.project.domainLayer.entitiesInterfaces.ValueObject; 4 | 5 | import java.util.Objects; 6 | 7 | /** 8 | * The type Amount. 9 | */ 10 | public class Amount implements ValueObject { 11 | 12 | private double amount; 13 | 14 | //Constructor 15 | 16 | /** 17 | * Create amount amount. 18 | * 19 | * @param amount the amount 20 | * @return the amount 21 | */ 22 | public static Amount createAmount(double amount){ 23 | return new Amount(amount); 24 | } 25 | 26 | private Amount (double amount) { 27 | this.amount= amount; 28 | } 29 | 30 | //get amount 31 | 32 | /** 33 | * Gets amount. 34 | * 35 | * @return the amount 36 | */ 37 | public double getAmount() { 38 | return amount; 39 | } 40 | 41 | //Equals 42 | 43 | /** 44 | * Equals boolean. 45 | * 46 | * @param o the o 47 | * @return the boolean 48 | */ 49 | @Override 50 | public boolean equals(Object o) { 51 | if (this == o) return true; 52 | if (o == null || getClass() != o.getClass()) return false; 53 | Amount amount1 = (Amount) o; 54 | return Double.compare(amount1.amount, amount) == 0; 55 | } 56 | 57 | //HashCode 58 | 59 | /** 60 | * Hash code int. 61 | * 62 | * @return the int 63 | */ 64 | @Override 65 | public int hashCode() { 66 | return Objects.hash(amount); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/domainEntities/vosShared/Date.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.domainEntities.vosShared; 2 | 3 | import com.finance.project.domainLayer.entitiesInterfaces.ValueObject; 4 | 5 | import java.time.LocalDate; 6 | import java.util.Objects; 7 | 8 | /** 9 | * The type Date. 10 | */ 11 | public class Date implements ValueObject { 12 | private LocalDate date; 13 | 14 | //Constructor 15 | 16 | /** 17 | * Create date date. 18 | * 19 | * @param date the date 20 | * @return the date 21 | */ 22 | public static Date createDate(LocalDate date) { 23 | return new Date(date); 24 | } 25 | 26 | private Date(LocalDate date) { 27 | if (date == null) { 28 | throw new IllegalArgumentException("Date not created due to the fact that the date parameter hasn't a valid argument"); 29 | } 30 | this.date = date; 31 | } 32 | 33 | //get date 34 | 35 | /** 36 | * Gets date. 37 | * 38 | * @return the date 39 | */ 40 | public LocalDate getDate() { 41 | return date; 42 | } 43 | 44 | //Equals 45 | 46 | /** 47 | * Equals boolean. 48 | * 49 | * @param o the o 50 | * @return the boolean 51 | */ 52 | @Override 53 | public boolean equals(Object o) { 54 | if (this == o) return true; 55 | if (o == null || getClass() != o.getClass()) return false; 56 | Date date1 = (Date) o; 57 | return Objects.equals(date, date1.date); 58 | } 59 | 60 | //Hashcode 61 | 62 | /** 63 | * Hash code int. 64 | * 65 | * @return the int 66 | */ 67 | @Override 68 | public int hashCode() { 69 | return Objects.hash(date); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/domainEntities/vosShared/Description.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.domainEntities.vosShared; 2 | 3 | import com.finance.project.domainLayer.entitiesInterfaces.ValueObject; 4 | 5 | import javax.persistence.Embeddable; 6 | import java.io.Serializable; 7 | import java.util.Objects; 8 | 9 | /** 10 | * The type Description. 11 | */ 12 | @Embeddable 13 | public class Description implements ValueObject, Serializable { 14 | 15 | private String description; 16 | 17 | //Constructor 18 | 19 | /** 20 | * Create description description. 21 | * 22 | * @param description the description 23 | * @return the description 24 | */ 25 | public static Description createDescription(String description){ 26 | return new Description(description); 27 | } 28 | 29 | private Description(String description) { 30 | this.description = description; 31 | } 32 | 33 | //get Description 34 | 35 | /** 36 | * Gets description. 37 | * 38 | * @return the description 39 | */ 40 | public String getDescription() { 41 | return description; 42 | } 43 | 44 | public Description() { 45 | } 46 | //Equals 47 | 48 | /** 49 | * Equals boolean. 50 | * 51 | * @param o the o 52 | * @return the boolean 53 | */ 54 | @Override 55 | public boolean equals(Object o) { 56 | if (this == o) return true; 57 | if (o == null || getClass() != o.getClass()) return false; 58 | Description that = (Description) o; 59 | return Objects.equals(description.toUpperCase(), that.description.toUpperCase()); 60 | } 61 | 62 | //Hashcode 63 | 64 | /** 65 | * Hash code int. 66 | * 67 | * @return the int 68 | */ 69 | @Override 70 | public int hashCode() { 71 | return Objects.hash(description); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/domainEntities/vosShared/LedgerID.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.domainEntities.vosShared; 2 | 3 | import com.finance.project.domainLayer.entitiesInterfaces.ValueObject; 4 | 5 | import javax.persistence.Embeddable; 6 | import java.io.Serializable; 7 | import java.util.Objects; 8 | import java.util.UUID; 9 | 10 | /** 11 | * create LedgerVO 12 | */ 13 | @Embeddable 14 | public class LedgerID implements ValueObject, Serializable { 15 | 16 | private String id; 17 | 18 | //Constructor 19 | 20 | /** 21 | * Create ledger id ledger id. 22 | * 23 | * @return the ledger id 24 | */ 25 | public static LedgerID createLedgerID() { 26 | return new LedgerID(); 27 | } 28 | 29 | public LedgerID() { 30 | UUID id = UUID.randomUUID(); 31 | this.id = id.toString(); 32 | } 33 | 34 | public LedgerID(String id) { 35 | this.id = id; 36 | } 37 | 38 | //get methods 39 | 40 | /** 41 | * Gets ledger id. 42 | * 43 | * @return the ledger id 44 | */ 45 | public String getLedgerID() { 46 | return id; 47 | } 48 | 49 | public void setLedgerID(String id) { 50 | this.id = id; 51 | } 52 | 53 | //Equals 54 | 55 | /** 56 | * Equals boolean. 57 | * 58 | * @param o the o 59 | * @return the boolean 60 | */ 61 | @Override 62 | public boolean equals(Object o) { 63 | if (this == o) return true; 64 | if (o == null || getClass() != o.getClass()) return false; 65 | LedgerID ledgerID = (LedgerID) o; 66 | return Objects.equals(id, ledgerID.id); 67 | } 68 | 69 | //HashCode 70 | 71 | /** 72 | * Hash code int. 73 | * 74 | * @return the int 75 | */ 76 | @Override 77 | public int hashCode() { 78 | return Objects.hash(id); 79 | } 80 | 81 | @Override 82 | public String toString() { 83 | return "LedgerID{" + 84 | "id='" + id + '\'' + 85 | '}'; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/domainEntities/vosShared/TransactionType.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.domainEntities.vosShared; 2 | 3 | import com.finance.project.domainLayer.entitiesInterfaces.ValueObject; 4 | 5 | import java.util.Objects; 6 | 7 | /** 8 | * The type Transaction type. 9 | */ 10 | public class TransactionType implements ValueObject { 11 | 12 | private String transactionType; 13 | 14 | //Constructor 15 | 16 | /** 17 | * Create transaction type transaction type. 18 | * 19 | * @param transactionType the transaction type 20 | * @return the transaction type 21 | */ 22 | public static TransactionType createTransactionType(String transactionType){ 23 | return new TransactionType(transactionType); 24 | } 25 | 26 | private TransactionType (String transactionType) { 27 | this.transactionType= transactionType; 28 | } 29 | 30 | //get transactionType 31 | 32 | /** 33 | * Gets transaction type. 34 | * 35 | * @return the transaction type 36 | */ 37 | public String getTransactionType() { 38 | return transactionType; 39 | } 40 | 41 | //Equals 42 | 43 | /** 44 | * Equals boolean. 45 | * 46 | * @param o the o 47 | * @return the boolean 48 | */ 49 | @Override 50 | public boolean equals(Object o) { 51 | if (this == o) return true; 52 | if (o == null || getClass() != o.getClass()) return false; 53 | TransactionType that = (TransactionType) o; 54 | return Objects.equals(transactionType, that.transactionType); 55 | } 56 | 57 | //Hashcode 58 | 59 | /** 60 | * Hash code int. 61 | * 62 | * @return the int 63 | */ 64 | @Override 65 | public int hashCode() { 66 | return Objects.hash(transactionType); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/domainEntities/vosShared/Type.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.domainEntities.vosShared; 2 | 3 | import com.finance.project.domainLayer.entitiesInterfaces.ValueObject; 4 | 5 | import java.util.Objects; 6 | 7 | /** 8 | * The type Type. 9 | */ 10 | public class Type implements ValueObject { 11 | 12 | private String type; 13 | 14 | //Constructor 15 | 16 | /** 17 | * Create type type. 18 | * 19 | * @param type the type 20 | * @return the type 21 | */ 22 | public static Type createType(String type){ 23 | return new Type(type); 24 | } 25 | 26 | private Type (String type) { 27 | if (type == null || type.equals("")) { 28 | throw new IllegalArgumentException("Type not created due to the fact that the type parameter hasn't a valid argument"); 29 | } 30 | this.type= type; 31 | } 32 | 33 | //get Type 34 | 35 | /** 36 | * Gets type. 37 | * 38 | * @return the type 39 | */ 40 | public String getType() { 41 | return type; 42 | } 43 | 44 | //Equals 45 | 46 | /** 47 | * Equals boolean. 48 | * 49 | * @param o the o 50 | * @return the boolean 51 | */ 52 | @Override 53 | public boolean equals(Object o) { 54 | if (this == o) return true; 55 | if (o == null || getClass() != o.getClass()) return false; 56 | Type type1 = (Type) o; 57 | return Objects.equals(type.toUpperCase(), type1.type.toUpperCase()); 58 | } 59 | 60 | //Hashcode 61 | 62 | /** 63 | * Hash code int. 64 | * 65 | * @return the int 66 | */ 67 | @Override 68 | public int hashCode() { 69 | return Objects.hash(type); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/entitiesInterfaces/Entity.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.entitiesInterfaces; 2 | 3 | public interface Entity { 4 | } 5 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/entitiesInterfaces/Owner.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.entitiesInterfaces; 2 | 3 | import com.finance.project.domainLayer.domainEntities.vosShared.AccountID; 4 | import com.finance.project.domainLayer.domainEntities.vosShared.CategoryID; 5 | 6 | 7 | public interface Owner { 8 | 9 | boolean addCategory(CategoryID categoryID); 10 | 11 | boolean addAccount(AccountID accountID); 12 | } 13 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/entitiesInterfaces/OwnerID.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.entitiesInterfaces; 2 | 3 | public interface OwnerID { 4 | } 5 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/entitiesInterfaces/ValueObject.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.entitiesInterfaces; 2 | 3 | 4 | public interface ValueObject { 5 | } 6 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/exceptions/InvalidArgumentsBusinessException.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.exceptions; 2 | 3 | public class InvalidArgumentsBusinessException extends RuntimeException { 4 | 5 | public InvalidArgumentsBusinessException(String message) { 6 | super(message); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/exceptions/NotFoundArgumentsBusinessException.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.exceptions; 2 | 3 | 4 | public class NotFoundArgumentsBusinessException extends RuntimeException{ 5 | 6 | public NotFoundArgumentsBusinessException (String message) { 7 | super(message); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/exceptions/TransactionsNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.exceptions; 2 | 3 | public class TransactionsNotFoundException extends RuntimeException{ 4 | 5 | public TransactionsNotFoundException(String errorMessage) { 6 | super(errorMessage); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/repositoriesInterfaces/IAccountRepository.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.repositoriesInterfaces; 2 | 3 | import org.springframework.stereotype.Repository; 4 | import com.finance.project.domainLayer.domainEntities.aggregates.account.Account; 5 | import com.finance.project.domainLayer.domainEntities.vosShared.AccountID; 6 | 7 | import java.util.List; 8 | import java.util.Optional; 9 | 10 | 11 | @Repository 12 | public interface IAccountRepository { 13 | 14 | Account save(Account account); 15 | 16 | List findAll(); 17 | 18 | Optional findById(String id, String denomination); 19 | 20 | boolean existsById(AccountID accountID); 21 | 22 | long count(); 23 | 24 | void delete(Account account); 25 | 26 | List findAllById(String description, String denomination, String id); 27 | } -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/repositoriesInterfaces/ICategoryRepository.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.repositoriesInterfaces; 2 | 3 | import org.springframework.stereotype.Repository; 4 | import com.finance.project.domainLayer.domainEntities.aggregates.category.Category; 5 | import com.finance.project.domainLayer.domainEntities.vosShared.CategoryID; 6 | 7 | import java.util.List; 8 | import java.util.Optional; 9 | 10 | 11 | @Repository 12 | public interface ICategoryRepository { 13 | 14 | Category save(Category category); 15 | 16 | Optional findById(String id, String denomination); 17 | 18 | boolean existsById(CategoryID categoryID); 19 | 20 | long count(); 21 | 22 | List findAll(); 23 | 24 | void delete(CategoryID categoryID); 25 | 26 | List findAllById(String id, String denomination); 27 | } 28 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/repositoriesInterfaces/IGroupRepository.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.repositoriesInterfaces; 2 | 3 | import org.springframework.stereotype.Repository; 4 | import com.finance.project.domainLayer.domainEntities.aggregates.group.Group; 5 | import com.finance.project.domainLayer.domainEntities.vosShared.GroupID; 6 | import com.finance.project.domainLayer.domainEntities.vosShared.PersonID; 7 | 8 | import java.util.List; 9 | import java.util.Optional; 10 | 11 | 12 | @Repository 13 | public interface IGroupRepository { 14 | 15 | Group save(Group group); 16 | 17 | boolean addAndSaveAdmin(Group group, PersonID adminID); 18 | 19 | Optional findById(GroupID id); 20 | 21 | boolean addAndSaveLedger(Group group); 22 | 23 | List findAdminsById(GroupID id); 24 | 25 | boolean addAndSaveMember(Group group, PersonID memberID); 26 | 27 | boolean addAndSaveCategory(Group group); 28 | 29 | boolean addAndSaveAccount(Group group, String description); 30 | 31 | boolean exists(GroupID groupID); 32 | 33 | long count(); 34 | 35 | List findAll(); 36 | } 37 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/repositoriesInterfaces/ILedgerRepository.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.repositoriesInterfaces; 2 | 3 | import org.springframework.stereotype.Repository; 4 | import com.finance.project.dtos.dtos.DeleteGroupTransactionDTO; 5 | import com.finance.project.dtos.dtos.DeletePersonTransactionDTO; 6 | import com.finance.project.dtos.dtos.UpdateGroupTransactionDTO; 7 | import com.finance.project.dtos.dtos.UpdatePersonTransactionDTO; 8 | import com.finance.project.domainLayer.domainEntities.aggregates.ledger.Ledger; 9 | import com.finance.project.domainLayer.domainEntities.vosShared.LedgerID; 10 | 11 | import java.util.Optional; 12 | 13 | 14 | @Repository 15 | public interface ILedgerRepository { 16 | 17 | Ledger save(Ledger ledger); 18 | 19 | Optional findById(LedgerID id); 20 | 21 | boolean addAndSaveTransaction(Ledger ledger); 22 | 23 | boolean updatePersonTransaction(Ledger ledger, UpdatePersonTransactionDTO updatePersonTransactionDTO); 24 | 25 | boolean updateTransaction(Ledger ledger, UpdateGroupTransactionDTO updateGroupTransactionDTO); 26 | 27 | boolean deletePersonTransaction(Ledger ledger, DeletePersonTransactionDTO deletePersonTransactionDTO0); 28 | 29 | boolean deleteTransaction(Ledger ledger, DeleteGroupTransactionDTO deleteGroupTransactionDTO); 30 | 31 | boolean exists(LedgerID ledgerID); 32 | 33 | long count(); 34 | } 35 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/repositoriesInterfaces/IPersonRepository.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.repositoriesInterfaces; 2 | 3 | import org.springframework.stereotype.Repository; 4 | import com.finance.project.domainLayer.domainEntities.aggregates.person.Person; 5 | import com.finance.project.domainLayer.domainEntities.vosShared.PersonID; 6 | 7 | import java.util.List; 8 | import java.util.Optional; 9 | 10 | 11 | @Repository 12 | public interface IPersonRepository { 13 | 14 | 15 | Person save(Person person); 16 | 17 | Optional findById(PersonID id); 18 | 19 | boolean addAndSaveAddress(Person person); 20 | 21 | boolean addAndSaveLedger(Person person); 22 | 23 | boolean addAndSaveMother(Person person); 24 | 25 | boolean addAndSaveFather(Person person); 26 | 27 | boolean addAndSaveSibling(Person person, PersonID siblingID); 28 | 29 | public List findSiblingsById(PersonID id); 30 | 31 | boolean addAndSaveCategory(Person person); 32 | 33 | boolean addAndSaveAccount(Person person, String description); 34 | 35 | boolean exists(PersonID id); 36 | 37 | long count(); 38 | 39 | List findAll(); 40 | 41 | void delete(Person person); 42 | } 43 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/domainLayer/repositoriesInterfaces/IScheduleRepository.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.domainLayer.repositoriesInterfaces; 2 | 3 | import org.springframework.stereotype.Repository; 4 | import com.finance.project.domainLayer.domainEntities.aggregates.scheduling.Scheduling; 5 | import com.finance.project.domainLayer.domainEntities.vosShared.ScheduleID; 6 | 7 | import java.util.List; 8 | 9 | 10 | @Repository 11 | public interface IScheduleRepository { 12 | 13 | boolean saveScheduling(Scheduling scheduling); 14 | 15 | Scheduling findSchedulingByScheduleID(ScheduleID scheduleID); 16 | 17 | int countSchedulings(); 18 | 19 | boolean checkIfScheduleIDExists(ScheduleID scheduleID); 20 | 21 | List getSchedulings(); 22 | } 23 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/AccountDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import org.springframework.hateoas.RepresentationModel; 4 | 5 | import java.util.Objects; 6 | 7 | public class AccountDTO extends RepresentationModel { 8 | 9 | private String denomination; 10 | private String description; 11 | 12 | public AccountDTO(String denomination, String description) { 13 | this.denomination = denomination; 14 | this.description = description; 15 | } 16 | 17 | public String getDenomination() { 18 | return denomination; 19 | } 20 | 21 | public String getDescription() { 22 | return description; 23 | } 24 | 25 | @Override 26 | public boolean equals(Object o) { 27 | if (this == o) return true; 28 | if (o == null || getClass() != o.getClass()) return false; 29 | AccountDTO that = (AccountDTO) o; 30 | 31 | return Objects.equals(denomination, that.denomination) && 32 | Objects.equals(description, that.description); 33 | } 34 | 35 | @Override 36 | public int hashCode() { 37 | return Objects.hash(denomination, description); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/AccountsDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import org.springframework.hateoas.RepresentationModel; 4 | 5 | import java.util.List; 6 | import java.util.Objects; 7 | 8 | public class AccountsDTO extends RepresentationModel { 9 | 10 | private List accounts; 11 | 12 | public AccountsDTO(List accounts) { 13 | this.accounts = accounts; 14 | } 15 | 16 | public AccountsDTO() { 17 | 18 | } 19 | 20 | public List getAccounts() { 21 | return accounts; 22 | } 23 | 24 | public void setAccounts(List accounts) { 25 | this.accounts = accounts; 26 | } 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) return true; 31 | if (o == null || getClass() != o.getClass()) return false; 32 | AccountsDTO that = (AccountsDTO) o; 33 | return Objects.equals(getAccounts(), that.getAccounts()); 34 | } 35 | 36 | @Override 37 | public int hashCode() { 38 | return Objects.hash(super.hashCode(), getAccounts()); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/AddPersonToGroupDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import java.util.Objects; 4 | 5 | /** 6 | * The type Add person to group dto. 7 | */ 8 | public class AddPersonToGroupDTO { 9 | 10 | private String email; 11 | private String denomination; 12 | 13 | public AddPersonToGroupDTO(){ 14 | } 15 | 16 | 17 | public AddPersonToGroupDTO(String email, String denomination){ 18 | this.email = email; 19 | this.denomination = denomination; 20 | } 21 | 22 | 23 | public String getEmail() { 24 | return email; 25 | } 26 | 27 | public String getDenomination() { 28 | return denomination; 29 | } 30 | 31 | public void setEmail(String email) { 32 | this.email = email; 33 | } 34 | 35 | public void setDenomination(String denomination) { 36 | this.denomination = denomination; 37 | } 38 | 39 | 40 | @Override 41 | public boolean equals(Object o) { 42 | if (this == o) return true; 43 | if (!(o instanceof AddPersonToGroupDTO)) return false; 44 | AddPersonToGroupDTO addPersonToGroupDTO = (AddPersonToGroupDTO) o; 45 | return Objects.equals(getEmail(), addPersonToGroupDTO.getEmail()) && 46 | Objects.equals(getDenomination(), addPersonToGroupDTO.getDenomination()); 47 | } 48 | 49 | @Override 50 | public int hashCode() { 51 | return Objects.hash(email, denomination); 52 | } 53 | } 54 | 55 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/BooleanDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import org.springframework.hateoas.RepresentationModel; 4 | 5 | import java.util.Objects; 6 | 7 | 8 | public class BooleanDTO extends RepresentationModel { 9 | 10 | private boolean result; 11 | private String msg; 12 | 13 | 14 | public BooleanDTO(boolean result, String msg){ 15 | this.result=result; 16 | this.msg=msg; 17 | } 18 | 19 | public String getMsg() { 20 | return msg; 21 | } 22 | 23 | 24 | public boolean getResult() { 25 | return this.result; 26 | } 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) return true; 31 | if (!(o instanceof BooleanDTO)) return false; 32 | BooleanDTO that = (BooleanDTO) o; 33 | return result == that.result && 34 | msg.equals(that.msg); 35 | } 36 | 37 | @Override 38 | public int hashCode() { 39 | return Objects.hash(result, msg); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/CategoriesDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import org.springframework.hateoas.RepresentationModel; 4 | 5 | import java.util.List; 6 | import java.util.Objects; 7 | 8 | public class CategoriesDTO extends RepresentationModel { 9 | 10 | private List categories; 11 | 12 | public CategoriesDTO(List categories) { 13 | this.categories = categories; 14 | } 15 | 16 | public CategoriesDTO() { 17 | 18 | } 19 | 20 | public List getCategories() { 21 | return categories; 22 | } 23 | 24 | public void setCategories(List categories) { 25 | this.categories = categories; 26 | } 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) return true; 31 | if (o == null || getClass() != o.getClass()) return false; 32 | CategoriesDTO that = (CategoriesDTO) o; 33 | return Objects.equals(getCategories(), that.getCategories()); 34 | } 35 | 36 | @Override 37 | public int hashCode() { 38 | return Objects.hash(super.hashCode(), getCategories()); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/CreatePersonAccountDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import java.util.Objects; 4 | 5 | public class CreatePersonAccountDTO { 6 | 7 | private final String email; 8 | private final String description; // Account description 9 | private final String denomination; // Account denomination 10 | 11 | 12 | public CreatePersonAccountDTO(String email, String description, String denomination){ 13 | this.email = email; 14 | this.description = description; 15 | this.denomination = denomination; 16 | } 17 | 18 | // Getters 19 | 20 | public String getEmail() { 21 | return email; 22 | } 23 | 24 | public String getDenomination() { 25 | return denomination; 26 | } 27 | 28 | public String getDescription() { 29 | return description; 30 | } 31 | 32 | 33 | // Equals and hashCode 34 | 35 | @Override 36 | public boolean equals(Object o) { 37 | if (this == o) return true; 38 | if (o == null || getClass() != o.getClass()) return false; 39 | CreatePersonAccountDTO createPersonAccountDTO = (CreatePersonAccountDTO) o; 40 | return Objects.equals(email, createPersonAccountDTO.email) && 41 | Objects.equals(denomination, createPersonAccountDTO.denomination) && 42 | Objects.equals(description, createPersonAccountDTO.description); 43 | } 44 | 45 | @Override 46 | public int hashCode() { 47 | return Objects.hash(email, denomination, description); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/CreatePersonCategoryDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import java.util.Objects; 4 | 5 | 6 | public class CreatePersonCategoryDTO { 7 | 8 | private final String email; 9 | private final String denomination; // Category denomination 10 | 11 | public CreatePersonCategoryDTO(String email, String denomination) { 12 | this.email = email; 13 | this.denomination = denomination; 14 | } 15 | 16 | 17 | // Getters 18 | 19 | public String getEmail() { 20 | return email; 21 | } 22 | 23 | public String getDenomination() { 24 | return denomination; 25 | } 26 | 27 | 28 | // Equals and hashCode 29 | 30 | @Override 31 | public boolean equals(Object o) { 32 | if (this == o) return true; 33 | if (o == null || getClass() != o.getClass()) return false; 34 | CreatePersonCategoryDTO createPersonCategoryDTO = (CreatePersonCategoryDTO) o; 35 | return Objects.equals(email, createPersonCategoryDTO.email) && 36 | Objects.equals(denomination, createPersonCategoryDTO.denomination); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(email, denomination); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/CreatePersonDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import java.time.LocalDate; 4 | import java.util.Objects; 5 | 6 | 7 | public class CreatePersonDTO { 8 | 9 | private String email; 10 | private String name; 11 | private LocalDate birthdate; 12 | private String birthplace; 13 | 14 | 15 | public CreatePersonDTO(String email, String name, LocalDate birthdate, String birthplace) { 16 | this.email = email; 17 | this.name = name; 18 | this.birthdate = birthdate; 19 | this.birthplace = birthplace; 20 | } 21 | 22 | // Getters 23 | 24 | public String getEmail() { 25 | return email; 26 | } 27 | 28 | public String getName() { 29 | return name; 30 | } 31 | 32 | public LocalDate getBirthdate() { 33 | return birthdate; 34 | } 35 | 36 | public String getBirthplace() { 37 | return birthplace; 38 | } 39 | 40 | 41 | // Equals & hashCode 42 | 43 | @Override 44 | public boolean equals(Object o) { 45 | if (this == o) return true; 46 | if (o == null || getClass() != o.getClass()) return false; 47 | CreatePersonDTO that = (CreatePersonDTO) o; 48 | return Objects.equals(email, that.email) && 49 | Objects.equals(name, that.name) && 50 | Objects.equals(birthdate, that.birthdate) && 51 | Objects.equals(birthplace, that.birthplace); 52 | } 53 | 54 | @Override 55 | public int hashCode() { 56 | return Objects.hash(email, name, birthdate, birthplace); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/DeletePersonTransactionDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import java.util.Objects; 4 | 5 | /** 6 | * The type Create person transaction dto. 7 | * 8 | * @author Francisco Gaspar 9 | */ 10 | public class DeletePersonTransactionDTO { 11 | 12 | private final int transactionNumber; 13 | private final String email; 14 | 15 | /** 16 | * Instantiates a new Create person transaction dto. 17 | * 18 | * @param transactionNumber the transaction number 19 | * @param email the email 20 | */ 21 | public DeletePersonTransactionDTO(int transactionNumber, String email) { 22 | this.transactionNumber = transactionNumber; 23 | this.email = email; 24 | } 25 | 26 | /** 27 | * Gets transactionNumber. 28 | * 29 | * @return the transactionNumber 30 | */ 31 | public int getTransactionNumber() { 32 | return transactionNumber; 33 | } 34 | 35 | /** 36 | * Gets email. 37 | * 38 | * @return the email 39 | */ 40 | public String getEmail() { 41 | return email; 42 | } 43 | 44 | /** 45 | * Equals boolean. 46 | * 47 | * @param o the o 48 | * @return the boolean 49 | */ 50 | @Override 51 | public boolean equals(Object o) { 52 | if (this == o) return true; 53 | if (o == null || getClass() != o.getClass()) return false; 54 | DeletePersonTransactionDTO that = (DeletePersonTransactionDTO) o; 55 | return Objects.equals(email, that.email) && 56 | Objects.equals(transactionNumber, that.transactionNumber); 57 | } 58 | 59 | /** 60 | * Hash code int. 61 | * 62 | * @return the int 63 | */ 64 | @Override 65 | public int hashCode() { 66 | return Objects.hash(email, transactionNumber); 67 | } 68 | 69 | 70 | } 71 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/GroupAdminsDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import org.springframework.hateoas.RepresentationModel; 4 | 5 | import java.util.List; 6 | import java.util.Objects; 7 | 8 | public class GroupAdminsDTO extends RepresentationModel { 9 | 10 | private List peopleInCharge; 11 | 12 | public GroupAdminsDTO(List peopleInCharge) { 13 | this.peopleInCharge = peopleInCharge; 14 | } 15 | 16 | public GroupAdminsDTO() { 17 | 18 | } 19 | 20 | public List getPeopleInCharge() { 21 | return peopleInCharge; 22 | } 23 | 24 | public void setPeopleInCharge(List peopleInCharge) { 25 | this.peopleInCharge = peopleInCharge; 26 | } 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) return true; 31 | if (o == null || getClass() != o.getClass()) return false; 32 | GroupAdminsDTO that = (GroupAdminsDTO) o; 33 | return Objects.equals(getPeopleInCharge(), that.getPeopleInCharge()); 34 | } 35 | 36 | @Override 37 | public int hashCode() { 38 | return Objects.hash(super.hashCode(), getPeopleInCharge()); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/GroupAllMembersDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import org.springframework.hateoas.RepresentationModel; 4 | 5 | import java.util.List; 6 | import java.util.Objects; 7 | 8 | public class GroupAllMembersDTO extends RepresentationModel { 9 | 10 | private List allMembers; 11 | 12 | public GroupAllMembersDTO(List allMembers) { 13 | this.allMembers = allMembers; 14 | } 15 | 16 | public GroupAllMembersDTO() { 17 | } 18 | 19 | public List getAllMembers() { 20 | return allMembers; 21 | } 22 | 23 | public void setAllMembers(List allMembers) { 24 | this.allMembers = allMembers; 25 | } 26 | 27 | @Override 28 | public boolean equals(Object o) { 29 | if (this == o) return true; 30 | if (!(o instanceof GroupAllMembersDTO)) return false; 31 | if (!super.equals(o)) return false; 32 | GroupAllMembersDTO that = (GroupAllMembersDTO) o; 33 | return Objects.equals(getAllMembers(), that.getAllMembers()); 34 | } 35 | 36 | @Override 37 | public int hashCode() { 38 | return Objects.hash(super.hashCode(), getAllMembers()); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/GroupIDDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import org.springframework.hateoas.RepresentationModel; 4 | 5 | import java.util.Objects; 6 | 7 | /** 8 | * The type Group iddto. 9 | */ 10 | public class GroupIDDTO extends RepresentationModel { 11 | 12 | private String denomination; 13 | 14 | /** 15 | * Instantiates a new Group iddto. 16 | * 17 | * @param groupID the group id 18 | */ 19 | public GroupIDDTO(String groupID) { 20 | this.denomination = groupID; 21 | } 22 | 23 | /** 24 | * Gets denomination. 25 | * 26 | * @return the denomination 27 | */ 28 | public String getDenomination() { return denomination; } 29 | 30 | /** 31 | * Equals boolean. 32 | * 33 | * @param o the o 34 | * @return the boolean 35 | */ 36 | @Override 37 | public boolean equals(Object o) { 38 | if (this == o) return true; 39 | if (!(o instanceof GroupIDDTO)) return false; 40 | GroupIDDTO that = (GroupIDDTO) o; 41 | return denomination.equals(that.denomination); 42 | } 43 | 44 | /** 45 | * Hash code int. 46 | * 47 | * @return the int 48 | */ 49 | @Override 50 | public int hashCode() { 51 | return Objects.hash(denomination); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/GroupListDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import org.springframework.hateoas.RepresentationModel; 4 | 5 | import java.util.List; 6 | 7 | public class GroupListDTO extends RepresentationModel { 8 | 9 | private List groups; 10 | 11 | public GroupListDTO(List groups) { 12 | this.groups = groups; 13 | } 14 | 15 | public GroupListDTO() { 16 | } 17 | 18 | public List getGroups() { 19 | return groups; 20 | } 21 | 22 | public void setGroups(List groups) { 23 | this.groups = groups; 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/GroupMemberClearanceDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import java.util.Objects; 4 | 5 | public class GroupMemberClearanceDTO { 6 | 7 | private String memberID; 8 | private String clearance; 9 | 10 | public GroupMemberClearanceDTO(String memberID, String clearance) { 11 | this.memberID = memberID; 12 | this.clearance = clearance; 13 | } 14 | 15 | public GroupMemberClearanceDTO() { 16 | 17 | } 18 | 19 | public String getMemberID() { 20 | return memberID; 21 | } 22 | 23 | public String getClearance() { 24 | return clearance; 25 | } 26 | 27 | @Override 28 | public boolean equals(Object o) { 29 | if (this == o) return true; 30 | if (!(o instanceof GroupMemberClearanceDTO)) return false; 31 | GroupMemberClearanceDTO that = (GroupMemberClearanceDTO) o; 32 | return Objects.equals(memberID, that.memberID) && 33 | Objects.equals(clearance, that.clearance); 34 | } 35 | 36 | @Override 37 | public int hashCode() { 38 | return Objects.hash(memberID, clearance); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/GroupMembersDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import org.springframework.hateoas.RepresentationModel; 4 | 5 | import java.util.List; 6 | import java.util.Objects; 7 | 8 | public class GroupMembersDTO extends RepresentationModel { 9 | 10 | private List members; 11 | 12 | public GroupMembersDTO(List members) { 13 | this.members = members; 14 | } 15 | 16 | public GroupMembersDTO() { 17 | 18 | } 19 | 20 | public List getMembers() { 21 | return members; 22 | } 23 | 24 | public void setMembers(List members) { 25 | this.members = members; 26 | } 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) return true; 31 | if (o == null || getClass() != o.getClass()) return false; 32 | GroupMembersDTO that = (GroupMembersDTO) o; 33 | return Objects.equals(getMembers(), that.getMembers()); 34 | } 35 | 36 | @Override 37 | public int hashCode() { 38 | return Objects.hash(super.hashCode(), getMembers()); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/GroupTransactionsWithinPeriodDTOout.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import org.springframework.hateoas.RepresentationModel; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | import java.util.Objects; 8 | 9 | /** 10 | * The type Group transactions within period dt oout. 11 | */ 12 | public class GroupTransactionsWithinPeriodDTOout extends RepresentationModel { 13 | private List transactionsList; 14 | 15 | /** 16 | * Instantiates a new Group transactions within period dt oout. 17 | */ 18 | public GroupTransactionsWithinPeriodDTOout() { 19 | this.transactionsList = new ArrayList<>(); 20 | } 21 | 22 | /** 23 | * Instantiates a new Group transactions within period dt oout. 24 | * 25 | * @param transactionsList the transactions list 26 | */ 27 | public GroupTransactionsWithinPeriodDTOout(ArrayList transactionsList) { 28 | this.transactionsList = transactionsList; 29 | } 30 | 31 | /** 32 | * Gets transactions list. 33 | * 34 | * @return the transactions list 35 | */ 36 | public List getTransactionsList() { 37 | return transactionsList; 38 | } 39 | 40 | /** 41 | * Sets transactions list. 42 | * 43 | * @param transactionsList the transactions list 44 | */ 45 | public void setTransactionsList(ArrayList transactionsList) { 46 | this.transactionsList = transactionsList; 47 | } 48 | 49 | @Override 50 | public boolean equals(Object o) { 51 | if (this == o) return true; 52 | if (o == null || getClass() != o.getClass()) return false; 53 | GroupTransactionsWithinPeriodDTOout that = (GroupTransactionsWithinPeriodDTOout) o; 54 | return transactionsList.equals(that.transactionsList); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | return Objects.hash(transactionsList); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/GroupsThatAreFamilyDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import org.springframework.hateoas.RepresentationModel; 4 | 5 | import java.util.List; 6 | import java.util.Objects; 7 | 8 | /** 9 | * The type Groups that are family dto. 10 | */ 11 | public class GroupsThatAreFamilyDTO extends RepresentationModel { 12 | 13 | private List groupThatAreFamily; 14 | 15 | /** 16 | * Instantiates a new Groups that are family dto. 17 | * 18 | * @param groupThatAreFamily the group that are family 19 | */ 20 | public GroupsThatAreFamilyDTO(List groupThatAreFamily) { 21 | this.groupThatAreFamily = groupThatAreFamily; 22 | } 23 | 24 | /** 25 | * Gets group that are family. 26 | * 27 | * @return the group that are family 28 | */ 29 | public List getGroupThatAreFamily() { 30 | return groupThatAreFamily; 31 | } 32 | 33 | /** 34 | * Equals boolean. 35 | * 36 | * @param o the o 37 | * @return the boolean 38 | */ 39 | @Override 40 | public boolean equals(Object o) { 41 | if (this == o) return true; 42 | if (!(o instanceof GroupsThatAreFamilyDTO)) return false; 43 | GroupsThatAreFamilyDTO that = (GroupsThatAreFamilyDTO) o; 44 | return groupThatAreFamily.equals(that.groupThatAreFamily); 45 | } 46 | 47 | /** 48 | * Hash code int. 49 | * 50 | * @return the int 51 | */ 52 | @Override 53 | public int hashCode() { 54 | return Objects.hash(groupThatAreFamily); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/NewAddPersonToGroupInfoDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import java.util.Objects; 4 | 5 | /** 6 | * The type New add person to group info dto. 7 | */ 8 | public class NewAddPersonToGroupInfoDTO { 9 | private String email; 10 | 11 | /** 12 | * Instantiates a new New add person to group info dto. 13 | */ 14 | public NewAddPersonToGroupInfoDTO(){ 15 | } 16 | 17 | /** 18 | * Instantiates a new New add person to group info dto. 19 | * 20 | * @param email the email 21 | 22 | */ 23 | public NewAddPersonToGroupInfoDTO(String email){ 24 | this.email= email; 25 | } 26 | 27 | /** 28 | * Gets email. 29 | * 30 | * @return the email 31 | */ 32 | //Gets 33 | public String getEmail() { 34 | return email; 35 | } 36 | 37 | 38 | 39 | /** 40 | * Sets email. 41 | * 42 | * @param email the email 43 | */ 44 | //Sets 45 | public void setEmail(String email) { 46 | this.email = email; 47 | } 48 | 49 | 50 | //equals 51 | 52 | 53 | /** 54 | * Equals boolean. 55 | * 56 | * @param o the o 57 | * @return the boolean 58 | */ 59 | @Override 60 | 61 | public boolean equals(Object o) { 62 | if (this == o) return true; 63 | if (!(o instanceof NewAddPersonToGroupInfoDTO)) return false; 64 | NewAddPersonToGroupInfoDTO newAddPersonToGroupInfoDTO= (NewAddPersonToGroupInfoDTO) o; 65 | return Objects.equals(getEmail(), newAddPersonToGroupInfoDTO.getEmail()); 66 | } 67 | 68 | /** 69 | * Hash code int. 70 | * 71 | * @return the int 72 | */ 73 | //hashcode 74 | @Override 75 | public int hashCode() { 76 | return Objects.hash(email); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/NewGroupCategoryInfoDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import java.util.Objects; 4 | 5 | public class NewGroupCategoryInfoDTO { 6 | 7 | //Deve ter sempre um construtor (vazio, pelo menos) + getters e setters 8 | 9 | private String categoryDenomination; 10 | 11 | public NewGroupCategoryInfoDTO(String categoryDenomination) { 12 | this.categoryDenomination = categoryDenomination; 13 | } 14 | 15 | public NewGroupCategoryInfoDTO() { 16 | } 17 | 18 | public String getCategoryDenomination() { 19 | return categoryDenomination; 20 | } 21 | 22 | public void setCategoryDenomination(String categoryDenomination) { 23 | this.categoryDenomination = categoryDenomination; 24 | } 25 | 26 | @Override 27 | public boolean equals(Object o) { 28 | if (this == o) return true; 29 | if (o == null || getClass() != o.getClass()) return false; 30 | NewGroupCategoryInfoDTO that = (NewGroupCategoryInfoDTO) o; 31 | return Objects.equals(getCategoryDenomination(), that.getCategoryDenomination()); 32 | } 33 | 34 | @Override 35 | public int hashCode() { 36 | return Objects.hash(getCategoryDenomination()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/NewPersonAccountInfoDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import java.util.Objects; 4 | 5 | public class NewPersonAccountInfoDTO { 6 | 7 | private String description; // account description 8 | private String denomination; // account denomination 9 | 10 | public NewPersonAccountInfoDTO(String description, String denomination) { 11 | this.description = description; 12 | this.denomination = denomination; 13 | } 14 | 15 | public NewPersonAccountInfoDTO() { 16 | } 17 | 18 | 19 | // Getters 20 | public String getDenomination() { 21 | return denomination; 22 | } 23 | 24 | public String getDescription() { 25 | return description; 26 | } 27 | 28 | // Setters 29 | public void setDenomination(String denomination) { 30 | this.denomination = denomination; 31 | } 32 | 33 | public void setDescription(String description) { 34 | this.description = description; 35 | } 36 | 37 | 38 | @Override 39 | public boolean equals(Object o) { 40 | if (this == o) return true; 41 | if (o == null || getClass() != o.getClass()) return false; 42 | NewPersonAccountInfoDTO that = (NewPersonAccountInfoDTO) o; 43 | return Objects.equals(denomination, that.denomination) && 44 | Objects.equals(description, that.description); 45 | } 46 | 47 | @Override 48 | public int hashCode() { 49 | return Objects.hash(denomination, description); 50 | } 51 | } -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/NewPersonCategoryInfoDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import org.springframework.hateoas.RepresentationModel; 4 | 5 | import java.util.Objects; 6 | 7 | public class NewPersonCategoryInfoDTO extends RepresentationModel { 8 | 9 | private String denomination; // category denomination 10 | 11 | public NewPersonCategoryInfoDTO(String denomination) { 12 | this.denomination = denomination; 13 | } 14 | 15 | public NewPersonCategoryInfoDTO() { 16 | } 17 | 18 | // Getters 19 | 20 | public String getDenomination() { 21 | return denomination; 22 | } 23 | 24 | // Setters 25 | 26 | public void setDenomination(String denomination) { 27 | this.denomination = denomination; 28 | } 29 | 30 | @Override 31 | public boolean equals(Object o) { 32 | if (this == o) return true; 33 | if (o == null || getClass() != o.getClass()) return false; 34 | NewPersonCategoryInfoDTO that = (NewPersonCategoryInfoDTO) o; 35 | return Objects.equals(denomination, that.denomination); 36 | } 37 | 38 | @Override 39 | public int hashCode() { 40 | return Objects.hash(denomination); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/PersonEmailDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import org.springframework.hateoas.RepresentationModel; 4 | 5 | import java.util.Objects; 6 | 7 | /** 8 | * @author Ala Matos 9 | */ 10 | 11 | public class PersonEmailDTO extends RepresentationModel { 12 | 13 | private String email; 14 | 15 | public PersonEmailDTO(String email) { 16 | this.email = email; 17 | 18 | } 19 | 20 | /** 21 | * Gets email 22 | * 23 | * @return the email 24 | */ 25 | public String getEmail() { 26 | return email; 27 | } 28 | 29 | 30 | /** 31 | * Equals boolean used to compare objects of the class PersonEmailDTO 32 | * 33 | * @param o the object o 34 | * @return the boolean 35 | */ 36 | @Override 37 | public boolean equals(Object o) { 38 | if (this == o) return true; 39 | if (o == null || getClass() != o.getClass()) return false; 40 | PersonEmailDTO that = (PersonEmailDTO) o; 41 | return Objects.equals(email, that.email); 42 | } 43 | 44 | /** 45 | * Hash code int as outcome 46 | * 47 | * @return an int 48 | */ 49 | 50 | @Override 51 | public int hashCode() { 52 | return Objects.hash(email); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/PersonIDDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import java.util.Objects; 4 | 5 | /** 6 | * The type Person iddto. 7 | */ 8 | public class PersonIDDTO { 9 | 10 | private String email; 11 | 12 | /** 13 | * Instantiates a new Person iddto. 14 | * 15 | * @param personID the person id 16 | */ 17 | public PersonIDDTO(String personID) { 18 | this.email = personID; 19 | } 20 | 21 | /** 22 | * Gets denomination. 23 | * 24 | * @return the denomination 25 | */ 26 | public String getEmail() { return email; } 27 | 28 | /** 29 | * Equals boolean. 30 | * 31 | * @param o the o 32 | * @return the boolean 33 | */ 34 | 35 | 36 | @Override 37 | public boolean equals(Object o) { 38 | if (this == o) return true; 39 | if (!(o instanceof PersonIDDTO)) return false; 40 | PersonIDDTO that = (PersonIDDTO) o; 41 | return email.equals(that.email); 42 | } 43 | 44 | /** 45 | * Hash code int. 46 | * 47 | * @return the int 48 | */ 49 | @Override 50 | public int hashCode() { 51 | return Objects.hash(email); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/PersonSearchAccountRecordsInDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import java.util.Objects; 4 | 5 | public class PersonSearchAccountRecordsInDTO { 6 | private final String personEmail; 7 | private final String accountDenomination; 8 | private final String startDate; 9 | private final String endDate; 10 | 11 | 12 | public PersonSearchAccountRecordsInDTO(String personEmail, String accountDenomination, String startDate, String endDate) { 13 | this.personEmail = personEmail; 14 | this.accountDenomination = accountDenomination; 15 | this.startDate = startDate; 16 | this.endDate = endDate; 17 | } 18 | 19 | // Getters 20 | 21 | public String getPersonEmail() { 22 | return personEmail; 23 | } 24 | 25 | public String getAccountDenomination() { 26 | return accountDenomination; 27 | } 28 | 29 | public String getStartDate() { 30 | return startDate; 31 | } 32 | 33 | public String getEndDate() { 34 | return endDate; 35 | } 36 | 37 | 38 | // Equals and hashCode 39 | 40 | @Override 41 | public boolean equals(Object o) { 42 | if (this == o) return true; 43 | if (o == null || getClass() != o.getClass()) return false; 44 | PersonSearchAccountRecordsInDTO that = (PersonSearchAccountRecordsInDTO) o; 45 | return personEmail.equals(that.personEmail) && 46 | accountDenomination.equals(that.accountDenomination) && 47 | startDate.equals(that.startDate) && 48 | endDate.equals(that.endDate); 49 | } 50 | 51 | @Override 52 | public int hashCode() { 53 | return Objects.hash(personEmail, accountDenomination, startDate, endDate); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/PersonSearchAccountRecordsOutDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import org.springframework.hateoas.RepresentationModel; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | import java.util.Objects; 8 | 9 | 10 | public class PersonSearchAccountRecordsOutDTO extends RepresentationModel { 11 | private List transactions; 12 | 13 | public PersonSearchAccountRecordsOutDTO() { 14 | this.transactions = new ArrayList<>(); 15 | } 16 | 17 | public PersonSearchAccountRecordsOutDTO(ArrayList transactions) { 18 | this.transactions = transactions; 19 | } 20 | 21 | 22 | // Getters & setters 23 | 24 | public List getTransactions() { 25 | return transactions; 26 | } 27 | 28 | public void setTransactions(ArrayList transactions) { 29 | this.transactions = transactions; 30 | } 31 | 32 | 33 | // Equals and hashCode 34 | 35 | @Override 36 | public boolean equals(Object o) { 37 | if (this == o) return true; 38 | if (o == null || getClass() != o.getClass()) return false; 39 | if (!super.equals(o)) return false; 40 | PersonSearchAccountRecordsOutDTO that = (PersonSearchAccountRecordsOutDTO) o; 41 | return transactions.equals(that.transactions); 42 | } 43 | 44 | @Override 45 | public int hashCode() { 46 | return Objects.hash(super.hashCode(), transactions); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/PrepareInfoToCheckIfSiblingsDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import java.util.Objects; 4 | 5 | /** 6 | * @author Ala Matos 7 | */ 8 | 9 | public class PrepareInfoToCheckIfSiblingsDTO { 10 | 11 | private String email; 12 | private String siblingEmail; 13 | 14 | public PrepareInfoToCheckIfSiblingsDTO() { 15 | } 16 | 17 | public PrepareInfoToCheckIfSiblingsDTO(String email, String siblingsEmail) { 18 | this.email = email; 19 | this.siblingEmail = siblingsEmail; 20 | } 21 | 22 | 23 | public String getEmail() { 24 | return email; 25 | } 26 | 27 | public String getSiblingEmail() { 28 | return siblingEmail; 29 | } 30 | 31 | public void setEmail(String email) { 32 | this.email = email; 33 | } 34 | 35 | public void setSiblingEmail(String siblingEmail) { 36 | this.siblingEmail = siblingEmail; 37 | } 38 | 39 | @Override 40 | public boolean equals(Object o) { 41 | if (this == o) return true; 42 | if (o == null || getClass() != o.getClass()) return false; 43 | PrepareInfoToCheckIfSiblingsDTO PrepareInfoToCheckIfSiblingsDTO = (PrepareInfoToCheckIfSiblingsDTO) o; 44 | return Objects.equals(email, PrepareInfoToCheckIfSiblingsDTO.email) && 45 | Objects.equals(siblingEmail, PrepareInfoToCheckIfSiblingsDTO.siblingEmail); 46 | } 47 | 48 | @Override 49 | public int hashCode() { 50 | return Objects.hash(email, siblingEmail); 51 | } 52 | } -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/SiblingsDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import org.springframework.hateoas.RepresentationModel; 4 | 5 | import java.util.List; 6 | import java.util.Objects; 7 | 8 | public class SiblingsDTO extends RepresentationModel { 9 | 10 | private List siblings; 11 | 12 | public SiblingsDTO(List siblings) { 13 | this.siblings = siblings; 14 | } 15 | 16 | public SiblingsDTO() { 17 | 18 | } 19 | 20 | public List getSiblings() { 21 | return siblings; 22 | } 23 | 24 | public void setSiblings(List siblings) { 25 | this.siblings = siblings; 26 | } 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) return true; 31 | if (o == null || getClass() != o.getClass()) return false; 32 | SiblingsDTO that = (SiblingsDTO) o; 33 | return Objects.equals(getSiblings(), that.getSiblings()); 34 | } 35 | 36 | @Override 37 | public int hashCode() { 38 | return Objects.hash(super.hashCode(), getSiblings()); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtos/TransactionsDTO.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtos; 2 | 3 | import org.springframework.hateoas.RepresentationModel; 4 | 5 | import java.util.List; 6 | import java.util.Objects; 7 | 8 | public class TransactionsDTO extends RepresentationModel { 9 | 10 | private List transactions; 11 | 12 | public TransactionsDTO(List transactions) { 13 | this.transactions = transactions; 14 | } 15 | 16 | public TransactionsDTO() { 17 | } 18 | 19 | public List getTransactions() { 20 | return transactions; 21 | } 22 | 23 | public void setTransactions(List transactions) { 24 | this.transactions = transactions; 25 | } 26 | 27 | @Override 28 | public boolean equals(Object o) { 29 | if (this == o) return true; 30 | if (o == null || getClass() != o.getClass()) return false; 31 | TransactionsDTO that = (TransactionsDTO) o; 32 | return Objects.equals(getTransactions(), that.getTransactions()); 33 | } 34 | 35 | @Override 36 | public int hashCode() { 37 | return Objects.hash(super.hashCode(), getTransactions()); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/AccountDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.AccountDTO; 4 | 5 | public class AccountDTOAssembler { 6 | 7 | public static AccountDTO createDTOFromPrimitiveTypes(String denomination, String description) { 8 | 9 | AccountDTO accountsDTO = new AccountDTO(denomination, description); 10 | 11 | return accountsDTO; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/AccountsDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.AccountDTO; 4 | import com.finance.project.dtos.dtos.AccountsDTO; 5 | 6 | import java.util.List; 7 | 8 | public class AccountsDTOAssembler { 9 | 10 | public static AccountsDTO createDTOFromDomainObject(List accountDTOS) { 11 | 12 | AccountsDTO accountsDTO = new AccountsDTO(accountDTOS); 13 | 14 | return accountsDTO; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/AddPersonToGroupDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.AddPersonToGroupDTO; 4 | 5 | /** 6 | * The type Add person to group dto assembler. 7 | * 8 | * @author Elisabete_Cavaleiro 9 | */ 10 | 11 | 12 | public class AddPersonToGroupDTOAssembler { 13 | 14 | /** 15 | * Create data transfer object primitives add person to group dto. 16 | * 17 | * @param email the email 18 | * @param denomination the denomination 19 | * @return the add person to group dto 20 | */ 21 | public static AddPersonToGroupDTO createDataTransferObject_Primitives(String email, String denomination){ 22 | return new AddPersonToGroupDTO(email, denomination); 23 | } 24 | } -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/BooleanDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.BooleanDTO; 4 | 5 | 6 | public class BooleanDTOAssembler { 7 | 8 | public static BooleanDTO createDTOFromPrimitiveTypes(boolean result, String msg){ 9 | return new BooleanDTO(result,msg); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/CategoriesDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.CategoriesDTO; 4 | import com.finance.project.domainLayer.domainEntities.vosShared.CategoryID; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public class CategoriesDTOAssembler { 10 | 11 | public static CategoriesDTO createDTOFromDomainObject(List categoriesIDs) { 12 | List categories = new ArrayList<>(); 13 | 14 | for(CategoryID categoryID : categoriesIDs){ 15 | categories.add(categoryID.getDenomination().getDenomination()); 16 | } 17 | 18 | CategoriesDTO categoriesDTO = new CategoriesDTO(categories); 19 | return categoriesDTO; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/CheckIfSiblingsDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.CheckIfSiblingsDTO; 4 | 5 | /** 6 | * The type Check if siblings dto assembler. 7 | * 8 | * @author Ala Matos 9 | */ 10 | public class CheckIfSiblingsDTOAssembler { 11 | /** 12 | * Create dto from primitive types check if siblings dto. 13 | * 14 | * @param email the email 15 | * @param siblingsEmail the siblings email 16 | * @return the check if siblings dto 17 | */ 18 | public static CheckIfSiblingsDTO createDTOFromPrimitiveTypes(String email, String siblingsEmail) { 19 | CheckIfSiblingsDTO checkIfSiblingsDTO = new CheckIfSiblingsDTO(email, siblingsEmail); 20 | return checkIfSiblingsDTO; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/CreateGroupAccountDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.CreateGroupAccountDTO; 4 | 5 | /** 6 | * The type Create group account dto assembler. 7 | */ 8 | public class CreateGroupAccountDTOAssembler { 9 | 10 | /** 11 | * Create dto from primitive types create group account dto. 12 | * 13 | * @param personEmail the person email 14 | * @param groupDenomination the group denomination 15 | * @param accountDescription the account description 16 | * @param accountDenomination the account denomination 17 | * @return the create group account dto 18 | */ 19 | public static CreateGroupAccountDTO createDTOFromPrimitiveTypes(String personEmail, String groupDenomination, String accountDescription, String accountDenomination) { 20 | CreateGroupAccountDTO createGroupAccountDTO = new CreateGroupAccountDTO(personEmail, groupDenomination, accountDescription, accountDenomination); 21 | return createGroupAccountDTO; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/CreateGroupCategoryDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.CreateGroupCategoryDTO; 4 | 5 | /** 6 | * The type Create group category dto assembler. 7 | */ 8 | public class CreateGroupCategoryDTOAssembler { 9 | 10 | /** 11 | * Create dto from primitive types create group category dto. 12 | * 13 | * @param personEmail the person email 14 | * @param groupDenomination the group denomination 15 | * @param categoryDenomination the category denomination 16 | * @return the create group category dto 17 | */ 18 | public static CreateGroupCategoryDTO createDTOFromPrimitiveTypes(String personEmail, String groupDenomination, String categoryDenomination) { 19 | CreateGroupCategoryDTO createGroupCategoryDTO = new CreateGroupCategoryDTO(personEmail, groupDenomination, categoryDenomination); 20 | return createGroupCategoryDTO; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/CreateGroupDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.CreateGroupDTO; 4 | 5 | /** 6 | * The type Create group dto assembler. 7 | */ 8 | public class CreateGroupDTOAssembler { 9 | 10 | /** 11 | * Create dto from primitve types create group dto. 12 | * 13 | * @param email the email 14 | * @param denomination the denomination 15 | * @param description the description 16 | * @return the create group dto 17 | */ 18 | public static CreateGroupDTO createDTOFromPrimitiveTypes(String email, String denomination, String description) { 19 | return new CreateGroupDTO(email, denomination, description); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/CreatePersonAccountDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.CreatePersonAccountDTO; 4 | 5 | /** 6 | * The type Create person account dto assembler. 7 | */ 8 | public class CreatePersonAccountDTOAssembler { 9 | 10 | /** 11 | * Create dto from primitve types create person account dto. 12 | * 13 | * @param email the email 14 | * @param denomination the denomination 15 | * @param description the description 16 | * @return the create person account dto 17 | */ 18 | public static CreatePersonAccountDTO createDTOFromPrimitiveTypes(String email, String description, String denomination) { 19 | CreatePersonAccountDTO createPersonAccountDTO = new CreatePersonAccountDTO(email, description, denomination); 20 | return createPersonAccountDTO; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/CreatePersonCategoryDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.CreatePersonCategoryDTO; 4 | 5 | /** 6 | * The type Create person category dto assembler. 7 | */ 8 | public class CreatePersonCategoryDTOAssembler { 9 | 10 | /** 11 | * Create dto from primitve types create person category dto. 12 | * 13 | * @param email the email 14 | * @param denomination the denomination 15 | * @return the create person category dto 16 | */ 17 | public static CreatePersonCategoryDTO createDTOFromPrimitiveTypes(String email,String denomination) { 18 | CreatePersonCategoryDTO createPersonCategoryDTO = new CreatePersonCategoryDTO(email, denomination); 19 | return createPersonCategoryDTO; 20 | } 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/CreatePersonDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.CreatePersonDTO; 4 | 5 | import java.time.LocalDate; 6 | import java.time.format.DateTimeFormatter; 7 | 8 | /** 9 | * The type Create person dto assembler. 10 | */ 11 | 12 | public class CreatePersonDTOAssembler { 13 | 14 | /** 15 | * Create dto from primitve types create group dto. 16 | * 17 | * @param email the email 18 | * @param name the name 19 | * @param birthdate the birthdate 20 | * @param birthplace the birthplace 21 | * @return the create person dto 22 | */ 23 | 24 | public static CreatePersonDTO createDTOFromPrimitiveTypes(String email, String name, String birthdate, String birthplace) { 25 | 26 | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); 27 | 28 | LocalDate localDateBirthdate = LocalDate.parse(birthdate, formatter); 29 | 30 | return new CreatePersonDTO(email, name, localDateBirthdate, birthplace); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/CreatePersonTransactionDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.CreatePersonTransactionDTO; 4 | 5 | /** 6 | * The type Create person transaction dto assembler. 7 | */ 8 | public class CreatePersonTransactionDTOAssembler { 9 | 10 | private CreatePersonTransactionDTOAssembler() { 11 | } 12 | 13 | /** 14 | * Create dto from primitve types create person transaction dto. 15 | * 16 | * @param email the email 17 | * @param denominationCategory the denomination category 18 | * @param type the type 19 | * @param description the description 20 | * @param amount the amount 21 | * @param denominationAccountDeb the denomination account deb 22 | * @param denominationAccountCred the denomination account cred 23 | * @return the create person transaction dto 24 | */ 25 | public static CreatePersonTransactionDTO createDTOFromPrimitiveTypes(String email, String denominationCategory, String type, String description, double amount, String denominationAccountDeb, String denominationAccountCred, String date) { 26 | CreatePersonTransactionDTO createPersonTransactionDTO = new CreatePersonTransactionDTO(email, denominationCategory, type, description, amount, denominationAccountDeb, denominationAccountCred, date); 27 | return createPersonTransactionDTO; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/DeleteGroupTransactionDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.DeleteGroupTransactionDTO; 4 | 5 | /** 6 | * The type Create group transaction dto assembler. 7 | * 8 | * @author SWitCH 2019/2020 Group 3 9 | * @author Joana Correia 10 | * @version %I%, %G%

CreateGroupTransactionByMemberDTOAssembler class defines the DTO responsible for: - transfer data required to create a group transaction by a member of the group 11 | */ 12 | public class DeleteGroupTransactionDTOAssembler { 13 | 14 | /** 15 | * Create dto from primitive types create group transaction dto. 16 | * 17 | * @param groupDenomination Name of the group where the transaction refers to 18 | * @param personGroupMemberEmail Email of the member of the group that wants to add the transaction 19 | * @return CreateGroupTransactionByMemberDTO createGroupTransactionByMemberDTO 20 | */ 21 | public static DeleteGroupTransactionDTO createDTOFromPrimitiveTypes(int transactionNumber, String groupDenomination, String personGroupMemberEmail) { 22 | DeleteGroupTransactionDTO deleteGroupTransactionDTO = new DeleteGroupTransactionDTO(transactionNumber, groupDenomination, personGroupMemberEmail); 23 | return deleteGroupTransactionDTO; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/DeletePersonTransactionDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.DeletePersonTransactionDTO; 4 | 5 | public class DeletePersonTransactionDTOAssembler { 6 | 7 | private DeletePersonTransactionDTOAssembler() { 8 | } 9 | 10 | public static DeletePersonTransactionDTO createDTOFromPrimitiveTypes(int transactionNumber, String email) { 11 | DeletePersonTransactionDTO deletePersonTransactionDTO = new DeletePersonTransactionDTO(transactionNumber, email); 12 | return deletePersonTransactionDTO; 13 | 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/GroupAdminsDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.GroupAdminsDTO; 4 | import com.finance.project.domainLayer.domainEntities.vosShared.PersonID; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public class GroupAdminsDTOAssembler { 10 | 11 | public static GroupAdminsDTO createDTOFromDomainObject(List peopleInCharge) { 12 | List admins = new ArrayList<>(); 13 | 14 | for(PersonID personID : peopleInCharge){ 15 | admins.add(personID.getEmail().getEmail()); 16 | } 17 | 18 | GroupAdminsDTO groupAdminsDTO = new GroupAdminsDTO(admins); 19 | return groupAdminsDTO; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/GroupAllMembersDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.GroupAllMembersDTO; 4 | import com.finance.project.dtos.dtos.GroupMemberClearanceDTO; 5 | 6 | import java.util.List; 7 | 8 | public class GroupAllMembersDTOAssembler { 9 | 10 | public static GroupAllMembersDTO createDTOFromDomainObject(List allMembers) { 11 | 12 | GroupAllMembersDTO groupAllMembersDTO = new GroupAllMembersDTO(allMembers); 13 | return groupAllMembersDTO; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/GroupIDDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.GroupIDDTO; 4 | import com.finance.project.domainLayer.domainEntities.vosShared.GroupID; 5 | 6 | /** 7 | * The type Group iddto assembler. 8 | */ 9 | public class GroupIDDTOAssembler { 10 | 11 | /** 12 | * Create dto from domain object group iddto. 13 | * 14 | * @param groupID the group id 15 | * @return the group iddto 16 | */ 17 | public static GroupIDDTO createDTOFromDomainObject(GroupID groupID) { 18 | GroupIDDTO groupIDDTO = new GroupIDDTO(groupID.getDenomination().getDenomination()); 19 | return groupIDDTO; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/GroupListDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.GroupDTO; 4 | import com.finance.project.dtos.dtos.GroupListDTO; 5 | 6 | import java.util.List; 7 | 8 | public class GroupListDTOAssembler { 9 | 10 | public static GroupListDTO createDTOFromDomainObject(List listOfGroupDTO) { 11 | 12 | GroupListDTO groupListDTO = new GroupListDTO(listOfGroupDTO); 13 | return groupListDTO; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/GroupMemberClearanceDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.GroupMemberClearanceDTO; 4 | 5 | public class GroupMemberClearanceDTOAssembler { 6 | 7 | public static GroupMemberClearanceDTO createDTOFromDomainObject(String memberID, String clearance) { 8 | 9 | GroupMemberClearanceDTO groupMemberClearanceDTO = new GroupMemberClearanceDTO(memberID, clearance); 10 | return groupMemberClearanceDTO; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/GroupMembersDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.domainLayer.domainEntities.vosShared.PersonID; 4 | import com.finance.project.dtos.dtos.GroupMembersDTO; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public class GroupMembersDTOAssembler { 10 | 11 | public static GroupMembersDTO createDTOFromDomainObject(List members) { 12 | List groupMembers = new ArrayList<>(); 13 | 14 | for(PersonID personID : members){ 15 | groupMembers.add(personID.getEmail().getEmail()); 16 | } 17 | 18 | GroupMembersDTO groupMembersDTO = new GroupMembersDTO(groupMembers); 19 | return groupMembersDTO; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/GroupSearchAccountRecordsInDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.GroupSearchAccountRecordsInDTO; 4 | 5 | /** 6 | * DTO Assembler in - For retrieving the list of transactions of the group, by a member, 7 | * for a given account, within a given period. 8 | */ 9 | public class GroupSearchAccountRecordsInDTOAssembler { 10 | 11 | /** 12 | * Instantiates a new Group search account records in dto assembler. 13 | */ 14 | public GroupSearchAccountRecordsInDTOAssembler() { 15 | } 16 | 17 | /** 18 | * Creates a DTO (in) for retrieving the group transactions, by a member, 19 | * for a given account, within a given period. 20 | * 21 | * @param personEmail the person email (group member) 22 | * @param groupDenomination the group denomination 23 | * @param accountDenomination the denomination of the account to search 24 | * @param startDate the start date of the period to search 25 | * @param endDate the end date of the period to search 26 | * @return the DTO (in) for retrieving the group transactions, by a member, 27 | * for a given account, within a given period 28 | */ 29 | public static GroupSearchAccountRecordsInDTO groupSearchAccountRecordsInDTO(String personEmail, String groupDenomination, String accountDenomination, String startDate, String endDate) { 30 | GroupSearchAccountRecordsInDTO groupSearchAccountRecordsInDTO = new GroupSearchAccountRecordsInDTO(personEmail, groupDenomination, accountDenomination, startDate, endDate); 31 | return groupSearchAccountRecordsInDTO; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/GroupTransactionsWithinPeriodDTOinAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.GroupTransactionsWithinPeriodDTOin; 4 | 5 | import java.time.LocalDate; 6 | 7 | /** 8 | * The type Group transactions within period dt oin assembler. 9 | */ 10 | public class GroupTransactionsWithinPeriodDTOinAssembler { 11 | 12 | /** 13 | * Create group transactions within period dt oin group transactions within period dt oin. 14 | * 15 | * @param personEmail the person email 16 | * @param groupDenomination the group denomination 17 | * @param startDate the start date 18 | * @param endDate the end date 19 | * @return the group transactions within period dt oin 20 | */ 21 | public static GroupTransactionsWithinPeriodDTOin createGroupTransactionsWithinPeriodDTOin(String personEmail, String groupDenomination, LocalDate startDate, LocalDate endDate){ 22 | GroupTransactionsWithinPeriodDTOin groupTransactionsWithinPeriodDTOin = new GroupTransactionsWithinPeriodDTOin(personEmail, groupDenomination,startDate,endDate); 23 | return groupTransactionsWithinPeriodDTOin; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/GroupTransactionsWithinPeriodDTOoutAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.GroupTransactionsWithinPeriodDTOout; 4 | import com.finance.project.dtos.dtos.TransactionDTOout; 5 | import com.finance.project.domainLayer.domainEntities.aggregates.ledger.Transaction; 6 | 7 | import java.util.ArrayList; 8 | 9 | 10 | public final class GroupTransactionsWithinPeriodDTOoutAssembler { 11 | 12 | private GroupTransactionsWithinPeriodDTOoutAssembler() { 13 | } 14 | 15 | 16 | public static GroupTransactionsWithinPeriodDTOout getGroupTransactionsWithinPeriodDTOout(ArrayList transactions) { 17 | 18 | GroupTransactionsWithinPeriodDTOout groupTransactionsWithinPeriodDTOout = new GroupTransactionsWithinPeriodDTOout(); 19 | for (Transaction transaction : transactions) { 20 | TransactionDTOout transactionDTOout = TransactionDTOoutAssembler.createTransactionDTOout(transaction); 21 | groupTransactionsWithinPeriodDTOout.getTransactionsList().add(transactionDTOout); 22 | } 23 | return groupTransactionsWithinPeriodDTOout; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/GroupsThatAreFamilyDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.GroupIDDTO; 4 | import com.finance.project.dtos.dtos.GroupsThatAreFamilyDTO; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * The type Groups that are family dto assembler. 10 | */ 11 | public class GroupsThatAreFamilyDTOAssembler { 12 | 13 | /** 14 | * Create dto from domain object groups that are family dto. 15 | * 16 | * @param listOfGroupIDDTO the list of group iddto 17 | * @return the groups that are family dto 18 | */ 19 | public static GroupsThatAreFamilyDTO createDTOFromDomainObject(List listOfGroupIDDTO) { 20 | 21 | GroupsThatAreFamilyDTO groupsThatAreFamilyDTO = new GroupsThatAreFamilyDTO(listOfGroupIDDTO); 22 | return groupsThatAreFamilyDTO; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/PersonEmailDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.PersonEmailDTO; 4 | 5 | /** 6 | * @author Ala Matos 7 | */ 8 | 9 | public class PersonEmailDTOAssembler { 10 | 11 | /** 12 | * Create dto from primitive types boolean dto. 13 | * 14 | * @param email 15 | * @return the PersonEmailDTO 16 | */ 17 | 18 | public static PersonEmailDTO createPersonEmailDTO(String email) { 19 | return new PersonEmailDTO(email); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/PersonSearchAccountRecordsInDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.PersonSearchAccountRecordsInDTO; 4 | 5 | /** 6 | * DTO Assembler in - For retrieving the list of transactions of a person, for a given account, within a given period. 7 | */ 8 | 9 | public class PersonSearchAccountRecordsInDTOAssembler { 10 | 11 | private PersonSearchAccountRecordsInDTOAssembler() { 12 | } 13 | 14 | /** 15 | * Creates a DTO (in) for retrieving a person's transactions, for a given account, within a given period. 16 | * 17 | * @param personEmail the person email 18 | * @param accountDenomination the denomination of the account to search 19 | * @param startDate the start date of the period to search 20 | * @param endDate the end date of the period to search 21 | * @return Assembles the DTO (in) for retrieving a person's transactions, for a given account, within a given period 22 | */ 23 | public static PersonSearchAccountRecordsInDTO personAccountTransactionsInDTO(String personEmail, String accountDenomination, String startDate, String endDate) { 24 | PersonSearchAccountRecordsInDTO personSearchAccountRecordsInDTO = new PersonSearchAccountRecordsInDTO(personEmail, accountDenomination, startDate, endDate); 25 | return personSearchAccountRecordsInDTO; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/SearchAccountRecordsOutDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.PersonSearchAccountRecordsOutDTO; 4 | import com.finance.project.dtos.dtos.TransactionDTOout; 5 | import com.finance.project.domainLayer.domainEntities.aggregates.ledger.Transaction; 6 | 7 | import java.util.ArrayList; 8 | 9 | /** 10 | * DTO Assembler out - Info for delivering the list of transactions of a person, for a given account, within a given period. 11 | */ 12 | 13 | public class SearchAccountRecordsOutDTOAssembler { 14 | 15 | private SearchAccountRecordsOutDTOAssembler() { 16 | } 17 | 18 | /** 19 | * Creates a DTO (out) for delivering a person's transactions, for a given account, within a given period. 20 | * 21 | * @param transactions the list of transactions 22 | * @return Assembles the DTO (out) for delivering a person's transactions, for a given account, within a given period 23 | */ 24 | public static PersonSearchAccountRecordsOutDTO accountTransactionsOutDTO(ArrayList transactions) { 25 | 26 | PersonSearchAccountRecordsOutDTO personSearchAccountRecordsOutDTO = new PersonSearchAccountRecordsOutDTO(); 27 | 28 | for (Transaction transaction : transactions) { 29 | TransactionDTOout transactionDTOout = TransactionDTOoutAssembler.createTransactionDTOout(transaction); 30 | personSearchAccountRecordsOutDTO.getTransactions().add(transactionDTOout); 31 | } 32 | return personSearchAccountRecordsOutDTO; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/SiblingsDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.domainLayer.domainEntities.vosShared.PersonID; 4 | import com.finance.project.dtos.dtos.SiblingsDTO; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public class SiblingsDTOAssembler { 10 | 11 | public static SiblingsDTO createDTOFromDomainObject(List siblings) { 12 | List personSiblings = new ArrayList<>(); 13 | 14 | for(PersonID personID : siblings){ 15 | personSiblings.add(personID.getEmail().getEmail()); 16 | } 17 | 18 | SiblingsDTO siblingsDTO = new SiblingsDTO(personSiblings); 19 | return siblingsDTO; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/TransactionDTOoutAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.domainLayer.domainEntities.aggregates.ledger.Transaction; 4 | import com.finance.project.dtos.dtos.TransactionDTOout; 5 | 6 | /** 7 | * The type Transaction dt oout assembler. 8 | */ 9 | public class TransactionDTOoutAssembler { 10 | private TransactionDTOoutAssembler() { 11 | } 12 | 13 | /** 14 | * Create transaction dt oout transaction dt oout. 15 | * 16 | * @param transaction the transaction 17 | * @return the transaction dt oout 18 | */ 19 | public static TransactionDTOout createTransactionDTOout (Transaction transaction){ 20 | TransactionDTOout transactionDTOout = new TransactionDTOout(); 21 | transactionDTOout.setCategory(transaction.getCategoryID().getDenomination().getDenomination()); 22 | transactionDTOout.setType(transaction.getType().getType()); 23 | transactionDTOout.setDescription(transaction.getDescription().getDescription()); 24 | transactionDTOout.setAmount(transaction.getAmount().getAmount()); 25 | transactionDTOout.setDate(transaction.getDate().getDate().toString()); 26 | transactionDTOout.setDebitAccount(transaction.getDebitAccountID().getDenomination().getDenomination()); 27 | transactionDTOout.setCreditAccount(transaction.getCreditAccountID().getDenomination().getDenomination()); 28 | return transactionDTOout; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/TransactionsDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.TransactionDTOout; 4 | import com.finance.project.dtos.dtos.TransactionsDTO; 5 | 6 | import java.util.List; 7 | 8 | public class TransactionsDTOAssembler { 9 | 10 | public static TransactionsDTO createDTOFromPrimitiveTypes(List transactions) { 11 | 12 | TransactionsDTO transactionsDTO = new TransactionsDTO(transactions); 13 | return transactionsDTO; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/dtos/dtosAssemblers/UpdatePersonTransactionDTOAssembler.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.dtos.dtos.UpdatePersonTransactionDTO; 4 | 5 | public class UpdatePersonTransactionDTOAssembler { 6 | 7 | private UpdatePersonTransactionDTOAssembler() { 8 | } 9 | 10 | public static UpdatePersonTransactionDTO createDTOFromPrimitiveTypes(int transactionNumber, String email, String denominationCategory, String type, String description, double amount, String denominationAccountDeb, String denominationAccountCred) { 11 | UpdatePersonTransactionDTO updatePersonTransactionDTO = new UpdatePersonTransactionDTO(transactionNumber, email, denominationCategory, type, description, amount, denominationAccountDeb, denominationAccountCred); 12 | return updatePersonTransactionDTO; 13 | 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/infrastructureLayer/infrastructureLayer_here.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/backend/src/main/java/com/finance/project/infrastructureLayer/infrastructureLayer_here.txt -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/persistenceLayer/jpa_repos_here.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/backend/src/main/java/com/finance/project/persistenceLayer/jpa_repos_here.txt -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/persistenceLayer/repositoriesJPA/AccountJpaRepository.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.persistenceLayer.repositoriesJPA; 2 | 3 | import com.finance.project.dataModel.dataModel.AbstractIdJpa; 4 | import com.finance.project.dataModel.dataModel.AccountJpa; 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import java.util.List; 8 | import java.util.Optional; 9 | 10 | public interface AccountJpaRepository extends CrudRepository { 11 | 12 | List findAll(); 13 | 14 | Optional findById(AbstractIdJpa id); 15 | 16 | boolean existsById(AbstractIdJpa id); 17 | 18 | long count(); 19 | 20 | void delete(AccountJpa accountJpa); 21 | 22 | List findAllById(AbstractIdJpa id); 23 | } -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/persistenceLayer/repositoriesJPA/AddressJpaRepository.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.persistenceLayer.repositoriesJPA; 2 | 3 | 4 | import com.finance.project.dataModel.dataModel.AddressJpa; 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import java.util.List; 8 | import java.util.Optional; 9 | 10 | public interface AddressJpaRepository extends CrudRepository { 11 | 12 | Optional findById(long id); 13 | List findAll(); 14 | } 15 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/persistenceLayer/repositoriesJPA/AdminJpaRepository.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.persistenceLayer.repositoriesJPA; 2 | 3 | 4 | import com.finance.project.dataModel.dataModel.AdminJpa; 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import java.util.List; 8 | 9 | public interface AdminJpaRepository extends CrudRepository { 10 | 11 | AdminJpa findById(long id); 12 | 13 | List findAll(); 14 | } 15 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/persistenceLayer/repositoriesJPA/CategoryJpaRepository.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.persistenceLayer.repositoriesJPA; 2 | 3 | import com.finance.project.dataModel.dataModel.AbstractIdJpa; 4 | import com.finance.project.dataModel.dataModel.CategoryJpa; 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import java.util.List; 8 | import java.util.Optional; 9 | 10 | public interface CategoryJpaRepository extends CrudRepository { 11 | 12 | List findAll(); 13 | 14 | Optional findById(AbstractIdJpa id); 15 | 16 | boolean existsById(AbstractIdJpa id); 17 | 18 | long count(); 19 | 20 | void delete(CategoryJpa categoryJpa); 21 | 22 | List findAllById(AbstractIdJpa id); 23 | } 24 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/persistenceLayer/repositoriesJPA/GroupJpaRepository.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.persistenceLayer.repositoriesJPA; 2 | 3 | 4 | import com.finance.project.dataModel.dataModel.GroupJpa; 5 | import org.springframework.data.repository.CrudRepository; 6 | import com.finance.project.domainLayer.domainEntities.vosShared.GroupID; 7 | 8 | import java.util.List; 9 | import java.util.Optional; 10 | 11 | public interface GroupJpaRepository extends CrudRepository { 12 | 13 | List findAll(); 14 | 15 | Optional findById(GroupID id); 16 | 17 | boolean existsById(GroupID id); 18 | 19 | long count(); 20 | } -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/persistenceLayer/repositoriesJPA/LedgerJpaRepository.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.persistenceLayer.repositoriesJPA; 2 | 3 | import com.finance.project.dataModel.dataModel.LedgerJpa; 4 | import org.springframework.data.repository.CrudRepository; 5 | import com.finance.project.domainLayer.domainEntities.vosShared.LedgerID; 6 | 7 | import java.util.List; 8 | import java.util.Optional; 9 | 10 | public interface LedgerJpaRepository extends CrudRepository { 11 | 12 | List findAll(); 13 | 14 | Optional findById(LedgerID id); 15 | 16 | boolean existsById(LedgerID id); 17 | 18 | long count(); 19 | } -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/persistenceLayer/repositoriesJPA/MemberJpaRepository.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.persistenceLayer.repositoriesJPA; 2 | 3 | 4 | import com.finance.project.dataModel.dataModel.MemberJpa; 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import java.util.List; 8 | 9 | public interface MemberJpaRepository extends CrudRepository { 10 | 11 | MemberJpa findById(long id); 12 | 13 | List findAll(); 14 | } 15 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/persistenceLayer/repositoriesJPA/PersonJpaRepository.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.persistenceLayer.repositoriesJPA; 2 | 3 | 4 | import com.finance.project.dataModel.dataModel.PersonJpa; 5 | import org.springframework.data.repository.CrudRepository; 6 | import com.finance.project.domainLayer.domainEntities.vosShared.PersonID; 7 | 8 | import java.util.List; 9 | import java.util.Optional; 10 | 11 | public interface PersonJpaRepository extends CrudRepository { 12 | 13 | List findAll(); 14 | 15 | Optional findById(PersonID id); 16 | 17 | boolean existsById(PersonID id); 18 | 19 | long count(); 20 | 21 | void delete(PersonJpa personJpa); 22 | } -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/persistenceLayer/repositoriesJPA/SiblingJpaRepository.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.persistenceLayer.repositoriesJPA; 2 | 3 | 4 | import com.finance.project.dataModel.dataModel.SiblingJpa; 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import java.util.List; 8 | 9 | public interface SiblingJpaRepository extends CrudRepository { 10 | 11 | SiblingJpa findById(long id); 12 | 13 | List findAll(); 14 | } 15 | -------------------------------------------------------------------------------- /backend/src/main/java/com/finance/project/persistenceLayer/repositoriesJPA/TransactionJpaRepository.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.persistenceLayer.repositoriesJPA; 2 | 3 | import com.finance.project.dataModel.dataModel.LedgerJpa; 4 | import com.finance.project.dataModel.dataModel.TransactionJpa; 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import java.util.List; 8 | import java.util.Optional; 9 | 10 | 11 | public interface TransactionJpaRepository extends CrudRepository { 12 | 13 | List findAll(); 14 | 15 | Optional findById(Long id); 16 | 17 | List findAllByLedger(LedgerJpa id); 18 | } -------------------------------------------------------------------------------- /backend/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/h2-console 3 | spring.jpa.hibernate.ddl-auto=create-drop 4 | 5 | # http://localhost:8080/h2-console/ 6 | 7 | # JDBC URL: jdbc:h2:mem:testdb -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/TestConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.finance.project; 2 | 3 | import com.finance.project.applicationLayer.applicationServices.groupServices.*; 4 | import com.finance.project.applicationLayer.applicationServices.otherServices.CheckSiblingsService; 5 | import com.finance.project.applicationLayer.applicationServices.otherServices.CheckGroupsFamilyService; 6 | import com.finance.project.applicationLayer.applicationServices.personServices.*; 7 | import org.springframework.boot.test.mock.mockito.MockBean; 8 | import org.springframework.context.annotation.Configuration; 9 | import org.springframework.context.annotation.Profile; 10 | 11 | 12 | @Profile("test") 13 | 14 | @Configuration 15 | 16 | 17 | public class TestConfiguration { 18 | 19 | // Person Services 20 | 21 | @MockBean 22 | public CreatePersonService createPersonService; 23 | 24 | @MockBean 25 | public CreatePersonCategoryService createPersonCategoryService; 26 | 27 | @MockBean 28 | public CreatePersonAccountService createPersonAccountService; 29 | 30 | @MockBean 31 | public CreatePersonTransactionService createPersonTransactionService; 32 | 33 | @MockBean 34 | public PersonSearchAccountRecordsService personSearchAccountRecordsService; 35 | 36 | 37 | // Group Services 38 | 39 | @MockBean 40 | public CreateGroupService createGroupService; 41 | 42 | @MockBean 43 | public AddPersonToGroupService uS003AddPersonToGroupService; 44 | 45 | @MockBean 46 | public CreateGroupCategoryService createGroupCategoryService; 47 | 48 | @MockBean 49 | public CreateGroupAccountService createGroupAccountService; 50 | 51 | @MockBean 52 | public CreateGroupTransactionService createGroupTransactionService; 53 | 54 | @MockBean 55 | public GroupSearchAccountRecordsService groupSearchAccountRecordsService; 56 | 57 | 58 | // Other Services 59 | 60 | @MockBean 61 | private CheckSiblingsService checkSiblingsService; 62 | 63 | @MockBean 64 | public CheckGroupsFamilyService checkGroupsFamilyService; 65 | 66 | } 67 | -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/applicationLayer/services_here.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/backend/src/test/java/com/finance/project/applicationLayer/services_here.txt -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/controllerLayer/integrationTests/CreatePersonCategoryControllerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.controllerLayer.integrationTests; 2 | 3 | import com.finance.project.applicationLayer.applicationServices.personServices.CreatePersonCategoryService; 4 | import org.json.JSONObject; 5 | import org.junit.jupiter.api.Assertions; 6 | import org.junit.jupiter.api.BeforeAll; 7 | import org.junit.jupiter.api.Test; 8 | import org.junit.jupiter.api.TestInstance; 9 | import org.springframework.boot.jdbc.EmbeddedDatabaseConnection; 10 | import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; 11 | import org.springframework.http.HttpStatus; 12 | import org.springframework.http.MediaType; 13 | import org.springframework.test.web.servlet.MvcResult; 14 | import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; 15 | import com.finance.project.dtos.dtos.NewPersonCategoryInfoDTO; 16 | 17 | import java.time.LocalDate; 18 | 19 | import static org.junit.jupiter.api.Assertions.assertEquals; 20 | import static org.junit.jupiter.api.Assertions.assertTrue; 21 | 22 | @TestInstance(TestInstance.Lifecycle.PER_CLASS) 23 | @AutoConfigureTestDatabase(connection = EmbeddedDatabaseConnection.H2) 24 | class CreatePersonCategoryControllerTest extends AbstractTest { 25 | 26 | @Override 27 | @BeforeAll 28 | public void setUp() { 29 | super.setUp(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/controllerLayer/integrationTests/CreatePersonTransactionControllerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.controllerLayer.integrationTests; 2 | 3 | import org.json.JSONObject; 4 | import org.junit.jupiter.api.*; 5 | import org.springframework.boot.jdbc.EmbeddedDatabaseConnection; 6 | import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; 7 | import org.springframework.http.HttpStatus; 8 | import org.springframework.http.MediaType; 9 | import org.springframework.test.web.servlet.MvcResult; 10 | import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; 11 | import com.finance.project.dtos.dtos.NewPersonTransactionInfoDTO; 12 | 13 | import java.time.LocalDate; 14 | 15 | import static org.junit.jupiter.api.Assertions.assertEquals; 16 | import static org.junit.jupiter.api.Assertions.assertTrue; 17 | 18 | @TestInstance(TestInstance.Lifecycle.PER_CLASS) 19 | @AutoConfigureTestDatabase(connection = EmbeddedDatabaseConnection.H2) 20 | @TestMethodOrder(MethodOrderer.Alphanumeric.class) 21 | public class CreatePersonTransactionControllerTest extends AbstractTest { 22 | 23 | @Override 24 | @BeforeAll 25 | public void setUp() { 26 | super.setUp(); 27 | } 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/controllerLayer/unitTests/CreateGroupControllerRESTTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.controllerLayer.unitTests; 2 | 3 | import com.finance.project.applicationLayer.applicationServices.groupServices.CreateGroupService; 4 | import com.finance.project.controllerLayer.controllersREST.groupControllers.CreateGroupControllerREST; 5 | import com.finance.project.controllerLayer.integrationTests.AbstractTest; 6 | import com.finance.project.domainLayer.domainEntities.aggregates.ledger.Transaction; 7 | import com.finance.project.domainLayer.domainEntities.vosShared.*; 8 | import com.finance.project.domainLayer.entitiesInterfaces.OwnerID; 9 | import com.finance.project.domainLayer.exceptions.InvalidArgumentsBusinessException; 10 | import com.finance.project.domainLayer.exceptions.NotFoundArgumentsBusinessException; 11 | import com.finance.project.dtos.dtos.*; 12 | import com.finance.project.dtos.dtosAssemblers.*; 13 | import org.junit.jupiter.api.Test; 14 | import org.mockito.Mock; 15 | import org.mockito.Mockito; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.http.HttpStatus; 18 | import org.springframework.http.ResponseEntity; 19 | 20 | import java.time.LocalDate; 21 | import java.util.ArrayList; 22 | import java.util.List; 23 | 24 | import static org.junit.jupiter.api.Assertions.assertEquals; 25 | import static org.junit.jupiter.api.Assertions.assertThrows; 26 | import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; 27 | 28 | class CreateGroupControllerRESTTest extends AbstractTest { 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/controllerLayer/unitTests/CreatePersonTransactionControllerRESTTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.controllerLayer.unitTests; 2 | 3 | import com.finance.project.applicationLayer.applicationServices.personServices.CreatePersonTransactionService; 4 | import com.finance.project.controllerLayer.controllersREST.personControllers.CreatePersonTransactionControllerREST; 5 | import com.finance.project.controllerLayer.integrationTests.AbstractTest; 6 | import com.finance.project.domainLayer.exceptions.NotFoundArgumentsBusinessException; 7 | import com.finance.project.dtos.dtosAssemblers.CreatePersonTransactionDTOAssembler; 8 | import org.junit.jupiter.api.DisplayName; 9 | import org.junit.jupiter.api.Test; 10 | import org.mockito.Mock; 11 | import org.mockito.Mockito; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import com.finance.project.dtos.dtos.CreatePersonTransactionDTO; 14 | import com.finance.project.dtos.dtos.NewPersonTransactionInfoDTO; 15 | 16 | import static org.junit.jupiter.api.Assertions.assertEquals; 17 | import static org.junit.jupiter.api.Assertions.assertThrows; 18 | 19 | class CreatePersonTransactionControllerRESTTest extends AbstractTest { 20 | 21 | @Mock 22 | private CreatePersonTransactionService service; 23 | @Autowired 24 | private CreatePersonTransactionControllerREST controller; 25 | 26 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/controllerLayer/unitTests/GroupSearchAccountRecordsControllerRESTTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.controllerLayer.unitTests; 2 | 3 | public class GroupSearchAccountRecordsControllerRESTTest { 4 | } 5 | -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/controllerLayer/unitTests/PersonSearchAccountRecordsControllerRESTTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.controllerLayer.unitTests; 2 | 3 | import com.finance.project.applicationLayer.applicationServices.personServices.PersonSearchAccountRecordsService; 4 | import com.finance.project.controllerLayer.controllersREST.personControllers.PersonSearchAccountRecordsControllerREST; 5 | import com.finance.project.controllerLayer.integrationTests.AbstractTest; 6 | import org.mockito.Mock; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | 9 | import static org.junit.jupiter.api.Assertions.assertEquals; 10 | 11 | class PersonSearchAccountRecordsControllerRESTTest extends AbstractTest { 12 | 13 | @Mock 14 | private PersonSearchAccountRecordsService personSearchAccountRecordsService; 15 | 16 | @Autowired 17 | private PersonSearchAccountRecordsControllerREST personSearchAccountRecordsControllerREST; 18 | 19 | 20 | 21 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/domainLayer/repositoriesInterfaces/repositories_Interfaces_here.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/backend/src/test/java/com/finance/project/domainLayer/repositoriesInterfaces/repositories_Interfaces_here.txt -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/AccountDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | import com.finance.project.dtos.dtos.AccountDTO; 6 | 7 | import static org.junit.jupiter.api.Assertions.*; 8 | 9 | class AccountDTOAssemblerTest { 10 | 11 | @Test 12 | @DisplayName("AccountDTOAssembler - Test create AccountDTODTO from Primitive Types") 13 | void AccountDTOAssembler_createDTOFromPrimitiveTypes() { 14 | 15 | //Arrange 16 | 17 | String companyDenomination = "Company"; 18 | String companyDescription = "Company account"; 19 | 20 | //Arrange 21 | AccountDTOAssembler accountDTOAssembler = new AccountDTOAssembler(); 22 | AccountDTO accountDTO = accountDTOAssembler.createDTOFromPrimitiveTypes(companyDenomination, companyDescription); 23 | 24 | //Expected 25 | AccountDTO accountDTOExpected = new AccountDTO(companyDenomination, companyDescription); 26 | 27 | //Assert 28 | assertEquals(accountDTOExpected, accountDTO); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/AccountsDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | import com.finance.project.dtos.dtos.AccountDTO; 6 | import com.finance.project.dtos.dtos.AccountsDTO; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | import static org.junit.jupiter.api.Assertions.assertEquals; 12 | 13 | class AccountsDTOAssemblerTest { 14 | 15 | @Test 16 | @DisplayName("AccountsDTOAssembler - Test create AccountsDTO from domain objects") 17 | void accountsDTOAssembler_createDTOFromDomainObject() { 18 | 19 | //Arrange 20 | 21 | String accountDenomination = "Supermarket Account"; 22 | String accountDescription = "Supermarket expenses"; 23 | 24 | AccountDTO accountDTO = AccountDTOAssembler.createDTOFromPrimitiveTypes(accountDenomination, accountDescription); 25 | 26 | List listAccountDTO = new ArrayList<>(); 27 | listAccountDTO.add(accountDTO); 28 | 29 | //Act 30 | AccountsDTOAssembler accountsDTOAssembler = new AccountsDTOAssembler(); 31 | AccountsDTO accountsDTO = accountsDTOAssembler.createDTOFromDomainObject(listAccountDTO); 32 | 33 | //Expected 34 | AccountsDTO accountsDTOExpected = new AccountsDTO(listAccountDTO); 35 | 36 | //Assert 37 | assertEquals(accountsDTOExpected, accountsDTO); 38 | } 39 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/AddPersonToGroupDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | import com.finance.project.dtos.dtos.AddPersonToGroupDTO; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | 9 | /** 10 | * @Elisabete_Cavaleiro 11 | */ 12 | 13 | class AddPersonToGroupDTOAssemblerTest { 14 | 15 | @Test 16 | @DisplayName("Test For createDataTransferObject_Primitives_addPersonToGroup()") 17 | void createDataTransferObject_Primitives() { 18 | 19 | // Arrange 20 | 21 | String personEmail = "cavaleiro@gmail.com"; 22 | String groupDenomination = "Dance"; 23 | 24 | AddPersonToGroupDTO expectedAddPersonToGroupDTO = new AddPersonToGroupDTO(personEmail, groupDenomination); 25 | 26 | // Act 27 | AddPersonToGroupDTOAssembler addPersonToGroupDTOAssembler = new AddPersonToGroupDTOAssembler(); 28 | AddPersonToGroupDTO addPersonToGroupDTO = addPersonToGroupDTOAssembler.createDataTransferObject_Primitives(personEmail, groupDenomination); 29 | 30 | // Assert 31 | 32 | assertEquals(expectedAddPersonToGroupDTO, addPersonToGroupDTO); 33 | assertEquals(personEmail, addPersonToGroupDTO.getEmail()); 34 | assertEquals(groupDenomination, addPersonToGroupDTO.getDenomination()); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/BooleanDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | import com.finance.project.dtos.dtos.BooleanDTO; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | 9 | class BooleanDTOAssemblerTest { 10 | 11 | 12 | @Test 13 | @DisplayName("Test For createDataTransferObject_DomainObjects()") 14 | void createDataTransferObject_DomainObjects() { 15 | 16 | // Arrange 17 | 18 | boolean result = true; 19 | String msg = "Sucess"; 20 | 21 | 22 | BooleanDTO expectedBooleanDTO = new BooleanDTO(result, msg); 23 | 24 | // Act 25 | 26 | BooleanDTOAssembler booleanDTOAssembler = new BooleanDTOAssembler(); 27 | BooleanDTO booleanDTO = booleanDTOAssembler.createDTOFromPrimitiveTypes(result, msg); 28 | 29 | // Assert 30 | 31 | assertEquals(expectedBooleanDTO, booleanDTO); 32 | assertEquals(result, booleanDTO.getResult()); 33 | assertEquals(msg, booleanDTO.getMsg()); 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/CategoriesDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.domainLayer.domainEntities.vosShared.CategoryID; 4 | import com.finance.project.domainLayer.domainEntities.vosShared.PersonID; 5 | import com.finance.project.domainLayer.entitiesInterfaces.OwnerID; 6 | import org.junit.jupiter.api.DisplayName; 7 | import org.junit.jupiter.api.Test; 8 | import com.finance.project.dtos.dtos.CategoriesDTO; 9 | 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | import static org.junit.jupiter.api.Assertions.assertEquals; 14 | 15 | class CategoriesDTOAssemblerTest { 16 | 17 | @Test 18 | @DisplayName("CategoriesDTOAssembler - Test create categoriesDTO from domain objects") 19 | void categoriesDTOAssembler_createDTOFromDomainObject() { 20 | 21 | //Arrange 22 | String emailMaria = "maria@gmail.com"; 23 | 24 | OwnerID ownerID = PersonID.createPersonID(emailMaria); 25 | 26 | String categoriesDenomination = "Food"; 27 | 28 | CategoryID categoryID = CategoryID.createCategoryID(categoriesDenomination, ownerID); 29 | 30 | List categoryIDS = new ArrayList<>(); 31 | categoryIDS.add(categoryID); 32 | 33 | //Act 34 | CategoriesDTOAssembler categoriesDTOAssembler = new CategoriesDTOAssembler(); 35 | CategoriesDTO categoriesDTO = categoriesDTOAssembler.createDTOFromDomainObject(categoryIDS); 36 | 37 | //Expected 38 | List categories = new ArrayList<>(); 39 | categories.add(categoriesDenomination); 40 | CategoriesDTO categoriesDTOExpected = new CategoriesDTO(categories); 41 | 42 | //Assert 43 | assertEquals(categoriesDTOExpected, categoriesDTO); 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/CreateGroupAccountDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | import com.finance.project.dtos.dtos.CreateGroupAccountDTO; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | 9 | public class CreateGroupAccountDTOAssemblerTest { 10 | 11 | @Test 12 | @DisplayName("Test For creating Data Transfer Objects - Primitives | Happy case") 13 | void createDTO_Primitives() { 14 | 15 | // Arrange 16 | String personEmail = "lebron@gmail.com"; 17 | String groupDenomination = "Lakers"; 18 | String accountDescription = "Lakers Expenses"; 19 | String accountDenomination = "LakersAccount"; 20 | 21 | CreateGroupAccountDTO expectedCreateGroupAccountDTO = new CreateGroupAccountDTO(personEmail, groupDenomination, accountDescription, accountDenomination); 22 | 23 | // Act 24 | CreateGroupAccountDTO createGroupAccountDTO = CreateGroupAccountDTOAssembler.createDTOFromPrimitiveTypes(personEmail, groupDenomination, accountDescription, accountDenomination); 25 | 26 | // Assert 27 | assertEquals(expectedCreateGroupAccountDTO, createGroupAccountDTO); 28 | assertEquals(personEmail, createGroupAccountDTO.getPersonEmail()); 29 | assertEquals(groupDenomination, createGroupAccountDTO.getGroupDenomination()); 30 | assertEquals(accountDescription, createGroupAccountDTO.getAccountDescription()); 31 | assertEquals(accountDenomination, createGroupAccountDTO.getAccountDenomination()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/CreateGroupCategoryDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | import com.finance.project.dtos.dtos.CreateGroupCategoryDTO; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | 9 | class CreateGroupCategoryDTOAssemblerTest { 10 | 11 | @Test 12 | @DisplayName("Test For createDataTransferObject_Primitives()") 13 | void createDataTransferObject_Primitives() { 14 | 15 | // Arrange 16 | 17 | String personEmail = "paulo@gmail.com"; 18 | String groupDenomination = "Runners"; 19 | String categoryDenomination = "Equipment"; 20 | 21 | CreateGroupCategoryDTO expectedCreateGroupCategoryDTO = new CreateGroupCategoryDTO(personEmail, groupDenomination, categoryDenomination); 22 | 23 | // Act 24 | 25 | CreateGroupCategoryDTOAssembler createGroupCategoryDTOAssembler = new CreateGroupCategoryDTOAssembler(); 26 | CreateGroupCategoryDTO createGroupCategoryDTO = createGroupCategoryDTOAssembler.createDTOFromPrimitiveTypes(personEmail, groupDenomination, categoryDenomination); 27 | 28 | // Assert 29 | 30 | assertEquals(expectedCreateGroupCategoryDTO, createGroupCategoryDTO); 31 | assertEquals(personEmail, createGroupCategoryDTO.getPersonEmail()); 32 | assertEquals(groupDenomination, createGroupCategoryDTO.getGroupDenomination()); 33 | assertEquals(categoryDenomination, createGroupCategoryDTO.getCategoryDenomination()); 34 | } 35 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/CreateGroupDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | import com.finance.project.dtos.dtos.CreateGroupDTO; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | 9 | class CreateGroupDTOAssemblerTest { 10 | 11 | @Test 12 | @DisplayName("Test create Data Transfer Object with Primitives || Happy case") 13 | void testCreateDataTransferObjectWithPrimitives(){ 14 | 15 | //Arrange 16 | String email = "maria@gmail.com"; 17 | String denomination = "Friends"; 18 | String description = "Old friends from school"; 19 | 20 | //Expected 21 | CreateGroupDTO createGroupDTOExpected = new CreateGroupDTO(email, denomination, description); 22 | 23 | //Act 24 | CreateGroupDTOAssembler createGroupDTOAssembler = new CreateGroupDTOAssembler(); 25 | CreateGroupDTO createGroupDTO = createGroupDTOAssembler.createDTOFromPrimitiveTypes(email, denomination, description); 26 | 27 | //Assert 28 | assertEquals(createGroupDTOExpected, createGroupDTO); 29 | assertEquals(email, createGroupDTO.getEmail()); 30 | assertEquals(denomination, createGroupDTO.getDenomination()); 31 | assertEquals(description, createGroupDTO.getDescription()); 32 | } 33 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/CreatePersonAccountDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | import com.finance.project.dtos.dtos.CreatePersonAccountDTO; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | 9 | public class CreatePersonAccountDTOAssemblerTest { 10 | 11 | @Test 12 | @DisplayName("Create DTO primitive type") 13 | void createDTO() { 14 | 15 | // Arrange 16 | String email = "santi@gmail.com"; 17 | String denomination = "Tennis"; 18 | String description = "Roland Garros 2020 tickets"; 19 | 20 | CreatePersonAccountDTO expected = new CreatePersonAccountDTO(email, description, denomination); 21 | 22 | // Act 23 | 24 | CreatePersonAccountDTOAssembler createPersonAccountDTOAssembler = new CreatePersonAccountDTOAssembler(); 25 | CreatePersonAccountDTO createPersonAccountDTO = createPersonAccountDTOAssembler.createDTOFromPrimitiveTypes(email, description, denomination); 26 | 27 | // Assert 28 | assertEquals(expected, createPersonAccountDTO); 29 | assertEquals(email, createPersonAccountDTO.getEmail()); 30 | assertEquals(denomination, createPersonAccountDTO.getDenomination()); 31 | assertEquals(description, createPersonAccountDTO.getDescription()); 32 | } 33 | 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/CreatePersonCategoryDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | import com.finance.project.dtos.dtos.CreatePersonCategoryDTO; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | 9 | class CreatePersonCategoryDTOAssemblerTest { 10 | 11 | @Test 12 | @DisplayName("Create DTO primitive type") 13 | void createDTO() { 14 | 15 | // Arrange 16 | String email = "lebron@gmail.com"; 17 | String denomination = "Basket"; 18 | 19 | CreatePersonCategoryDTO expected = new CreatePersonCategoryDTO(email, denomination); 20 | 21 | // Act 22 | 23 | CreatePersonCategoryDTOAssembler createPersonCategoryDTOAssembler = new CreatePersonCategoryDTOAssembler(); 24 | CreatePersonCategoryDTO createPersonCategoryDTO = createPersonCategoryDTOAssembler.createDTOFromPrimitiveTypes(email, denomination); 25 | 26 | // Assert 27 | assertEquals(expected, createPersonCategoryDTO); 28 | assertEquals(email, createPersonCategoryDTO.getEmail()); 29 | assertEquals(denomination, createPersonCategoryDTO.getDenomination()); 30 | } 31 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/CreatePersonDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | import com.finance.project.dtos.dtos.CreatePersonDTO; 6 | 7 | import java.time.LocalDate; 8 | 9 | import static org.junit.jupiter.api.Assertions.assertEquals; 10 | 11 | class CreatePersonDTOAssemblerTest { 12 | 13 | @Test 14 | @DisplayName("CreatePersonDTOAssembler - Test create Data Transfer Object with Primitives || Happy case") 15 | void createPersonDTOAssembler_CreateDataTransferObjectWithPrimitivesTest() { 16 | 17 | //Arrange 18 | String mariaEmail = "maria@gmail.com"; 19 | String mariaName = "Maria Silva"; 20 | LocalDate mariaBirthdate = LocalDate.of(1973, 07, 25); 21 | String mariaBirthdateString = "1973-07-25"; 22 | 23 | String mariaBirthplace = "Braga"; 24 | 25 | //Expected 26 | 27 | CreatePersonDTO createPersonDTOExpected = new CreatePersonDTO(mariaEmail, mariaName, mariaBirthdate, mariaBirthplace); 28 | 29 | //Act 30 | CreatePersonDTOAssembler createPersonDTOAssembler = new CreatePersonDTOAssembler(); 31 | CreatePersonDTO createPersonDTO = createPersonDTOAssembler.createDTOFromPrimitiveTypes(mariaEmail, mariaName, mariaBirthdateString, mariaBirthplace); 32 | 33 | //Assert 34 | assertEquals(createPersonDTOExpected, createPersonDTO); 35 | assertEquals(mariaEmail, createPersonDTO.getEmail()); 36 | assertEquals(mariaName, createPersonDTO.getName()); 37 | assertEquals(mariaBirthdate, createPersonDTO.getBirthdate()); 38 | assertEquals(mariaBirthplace, createPersonDTO.getBirthplace()); 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/CreatePersonTransactionDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | import com.finance.project.dtos.dtos.CreatePersonTransactionDTO; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | 9 | class CreatePersonTransactionDTOAssemblerTest { 10 | 11 | @Test 12 | @DisplayName("Test For createDataTransferObject_Primitives()") 13 | void createDTOFromPrimitiveTypes() { 14 | 15 | // Arrange 16 | 17 | String email = "paulo@gmail.com"; 18 | String denominationCategory = "HairStylist"; 19 | String type = "debit"; 20 | String description = "Pente0"; 21 | double amount = 150.0; 22 | String denominationAccountDeb = "DebitAccountJon"; 23 | String denominationAccountCred = "CredditAccountJon"; 24 | String date = "2020-03-05"; 25 | 26 | CreatePersonTransactionDTO expected_CreatePersonTransactionDTO = new CreatePersonTransactionDTO(email, denominationCategory, type, description, amount, denominationAccountDeb, denominationAccountCred, date); 27 | 28 | // Act 29 | 30 | CreatePersonTransactionDTO createPersonTransactionDTO = CreatePersonTransactionDTOAssembler.createDTOFromPrimitiveTypes(email, denominationCategory, type, description, amount, denominationAccountDeb, denominationAccountCred, date); 31 | 32 | // Assert 33 | 34 | assertEquals(expected_CreatePersonTransactionDTO, createPersonTransactionDTO); 35 | assertEquals(email, createPersonTransactionDTO.getEmail()); 36 | assertEquals(denominationCategory, createPersonTransactionDTO.getDenominationCategory()); 37 | assertEquals(type, createPersonTransactionDTO.getType()); 38 | assertEquals(description, createPersonTransactionDTO.getDescription()); 39 | assertEquals(amount, createPersonTransactionDTO.getAmount()); 40 | assertEquals(denominationAccountDeb, createPersonTransactionDTO.getDenominationAccountDeb()); 41 | assertEquals(denominationAccountCred, createPersonTransactionDTO.getDenominationAccountCred()); 42 | 43 | } 44 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/DeletePersonTransactionDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | import com.finance.project.dtos.dtos.DeletePersonTransactionDTO; 6 | 7 | import static org.junit.jupiter.api.Assertions.*; 8 | 9 | class DeletePersonTransactionDTOAssemblerTest { 10 | 11 | @Test 12 | @DisplayName("Test For createDataTransferObject_Primitives()") 13 | void createDataTransferObject_Primitives() { 14 | 15 | //Arrange 16 | 17 | int transactionNumber = 3; 18 | String email = "francisco@gmail.com"; 19 | 20 | DeletePersonTransactionDTO expectedDeletePersonTransactionDTO = new DeletePersonTransactionDTO(transactionNumber, email); 21 | 22 | //Act 23 | 24 | DeletePersonTransactionDTO deletePersonTransactionDTO = DeletePersonTransactionDTOAssembler.createDTOFromPrimitiveTypes(transactionNumber, email); 25 | 26 | //Arrange 27 | 28 | assertEquals(expectedDeletePersonTransactionDTO, deletePersonTransactionDTO); 29 | assertEquals(transactionNumber, deletePersonTransactionDTO.getTransactionNumber()); 30 | assertEquals(email, deletePersonTransactionDTO.getEmail()); 31 | 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/GroupAdminsDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.domainLayer.domainEntities.vosShared.PersonID; 4 | import org.junit.jupiter.api.DisplayName; 5 | import org.junit.jupiter.api.Test; 6 | import com.finance.project.dtos.dtos.GroupAdminsDTO; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | import static org.junit.jupiter.api.Assertions.assertEquals; 12 | 13 | class GroupAdminsDTOAssemblerTest { 14 | 15 | @Test 16 | @DisplayName("GroupAdminsDTOAssembler - Test create GroupMembersDTO from domain objects") 17 | void GroupAdminsDTOAssembler_createDTOFromDomainObject() { 18 | 19 | //Arrange 20 | String emailMaria = "maria@gmail.com"; 21 | PersonID idMaria = PersonID.createPersonID(emailMaria); 22 | 23 | List personIDs = new ArrayList<>(); 24 | personIDs.add(idMaria); 25 | 26 | //Arrange 27 | GroupAdminsDTOAssembler groupAdminsDTOAssembler = new GroupAdminsDTOAssembler(); 28 | GroupAdminsDTO groupAdminsDTO = groupAdminsDTOAssembler.createDTOFromDomainObject(personIDs); 29 | 30 | //Expected 31 | List persons = new ArrayList<>(); 32 | persons.add(emailMaria); 33 | GroupAdminsDTO groupMembersDTOExpected = new GroupAdminsDTO(persons); 34 | 35 | //Assert 36 | assertEquals(groupMembersDTOExpected, groupAdminsDTO); 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/GroupIDDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.domainLayer.domainEntities.vosShared.GroupID; 4 | import org.junit.jupiter.api.DisplayName; 5 | import org.junit.jupiter.api.Test; 6 | import com.finance.project.dtos.dtos.GroupIDDTO; 7 | 8 | import static org.junit.jupiter.api.Assertions.assertEquals; 9 | 10 | class GroupIDDTOAssemblerTest { 11 | 12 | @Test 13 | @DisplayName("Test create Data Transfer Object with Primitives - GroupID || Happy case") 14 | void testCreateDataTransferObjectWithPrimitives() { 15 | 16 | String denomination = "Dance"; 17 | GroupID groupID = GroupID.createGroupID(denomination); 18 | 19 | 20 | GroupIDDTO createGroupIDTOExpected = new GroupIDDTO(denomination); 21 | 22 | GroupIDDTOAssembler groupIDDTOAssembler = new GroupIDDTOAssembler(); 23 | 24 | GroupIDDTO groupIDDTO = groupIDDTOAssembler.createDTOFromDomainObject(groupID); 25 | 26 | assertEquals(createGroupIDTOExpected, groupIDDTO); 27 | 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/GroupMembersDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.domainLayer.domainEntities.vosShared.PersonID; 4 | import org.junit.jupiter.api.DisplayName; 5 | import org.junit.jupiter.api.Test; 6 | import com.finance.project.dtos.dtos.GroupMembersDTO; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | import static org.junit.jupiter.api.Assertions.assertEquals; 12 | 13 | class GroupMembersDTOAssemblerTest { 14 | 15 | @Test 16 | @DisplayName("GroupMembersDTOAssembler - Test create GroupMembersDTO from domain objects") 17 | void groupMembersDTOAssembler_createDTOFromDomainObject() { 18 | 19 | //Arrange 20 | String emailMaria = "maria@gmail.com"; 21 | PersonID idMaria = PersonID.createPersonID(emailMaria); 22 | 23 | List personIDs = new ArrayList<>(); 24 | personIDs.add(idMaria); 25 | 26 | //Arrange 27 | GroupMembersDTOAssembler groupMembersDTOAssembler = new GroupMembersDTOAssembler(); 28 | GroupMembersDTO groupMembersDTO = groupMembersDTOAssembler.createDTOFromDomainObject(personIDs); 29 | 30 | //Expected 31 | List persons = new ArrayList<>(); 32 | persons.add(emailMaria); 33 | GroupMembersDTO groupMembersDTOExpected = new GroupMembersDTO(persons); 34 | 35 | //Assert 36 | assertEquals(groupMembersDTOExpected, groupMembersDTO); 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/GroupSearchAccountRecordsInDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | import com.finance.project.dtos.dtos.GroupSearchAccountRecordsInDTO; 6 | 7 | import static org.junit.jupiter.api.Assertions.*; 8 | 9 | class GroupSearchAccountRecordsInDTOAssemblerTest { 10 | 11 | @Test 12 | @DisplayName("Test DTO assembler constructor") 13 | void constructorTest() { 14 | 15 | //Arrange 16 | String personEmail = "paulo@gmail.com"; 17 | String groupDenomination = "Fontes Family"; 18 | String accountDenomination = "Bank Account"; 19 | String startDate = "2020-01-21"; 20 | String endDate = "2020-01-29"; 21 | 22 | GroupSearchAccountRecordsInDTO expectedDTO = new GroupSearchAccountRecordsInDTO(personEmail, groupDenomination, accountDenomination, startDate, endDate); 23 | 24 | //Act 25 | GroupSearchAccountRecordsInDTO resultAssemblerDTO = GroupSearchAccountRecordsInDTOAssembler.groupSearchAccountRecordsInDTO(personEmail, groupDenomination, accountDenomination, startDate, endDate); 26 | 27 | //Assert 28 | assertEquals(expectedDTO, resultAssemblerDTO); 29 | assertEquals(personEmail, resultAssemblerDTO.getPersonEmail()); 30 | assertEquals(groupDenomination, resultAssemblerDTO.getGroupDenomination()); 31 | assertEquals(accountDenomination, resultAssemblerDTO.getAccountDenomination()); 32 | assertEquals(startDate, resultAssemblerDTO.getStartDate()); 33 | assertEquals(endDate, resultAssemblerDTO.getEndDate()); 34 | 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/GroupTransactionsWithinPeriodDTOinAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | import com.finance.project.dtos.dtos.GroupTransactionsWithinPeriodDTOin; 6 | 7 | import java.time.LocalDate; 8 | 9 | import static org.junit.jupiter.api.Assertions.assertEquals; 10 | 11 | class GroupTransactionsWithinPeriodDTOinAssemblerTest { 12 | @Test 13 | @DisplayName("Test DTO Constructor") 14 | void constructorTest() { 15 | //Arrange 16 | String personEmail = "paulo@gmail.com"; 17 | String groupDenomination = "House"; 18 | LocalDate startDate = LocalDate.of(2020, 01, 05); 19 | LocalDate endDate = LocalDate.of(2020, 02, 10); 20 | GroupTransactionsWithinPeriodDTOin expectedGroupTransactionsWithinPeriodDTOin = new GroupTransactionsWithinPeriodDTOin(personEmail, groupDenomination, startDate, endDate); 21 | 22 | //Act 23 | GroupTransactionsWithinPeriodDTOinAssembler groupTransactionsWithinPeriodDTOinAssembler = new GroupTransactionsWithinPeriodDTOinAssembler(); 24 | GroupTransactionsWithinPeriodDTOin assemblerDTOin = groupTransactionsWithinPeriodDTOinAssembler.createGroupTransactionsWithinPeriodDTOin(personEmail, groupDenomination, startDate, endDate); 25 | 26 | //Assert 27 | assertEquals(expectedGroupTransactionsWithinPeriodDTOin, assemblerDTOin); 28 | assertEquals(groupDenomination, assemblerDTOin.getGroupDenomination()); 29 | assertEquals(startDate, assemblerDTOin.getStartDate()); 30 | assertEquals(endDate, assemblerDTOin.getEndDate()); 31 | } 32 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/GroupsThatAreFamilyDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | import com.finance.project.dtos.dtos.GroupIDDTO; 6 | import com.finance.project.dtos.dtos.GroupsThatAreFamilyDTO; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | import static org.junit.jupiter.api.Assertions.assertEquals; 12 | 13 | 14 | class GroupsThatAreFamilyDTOAssemblerTest { 15 | 16 | @Test 17 | @DisplayName("Test create Data Transfer Object with Domain Objects || Happy case") 18 | void testCreateDataTransferObjectWithDomainObjects(){ 19 | 20 | //Arrange 21 | 22 | List families = new ArrayList<>(); 23 | 24 | //Act 25 | 26 | GroupsThatAreFamilyDTOAssembler groupsThatAreFamilyDTOAssembler = new GroupsThatAreFamilyDTOAssembler(); 27 | GroupsThatAreFamilyDTO groupsThatAreFamilyDTO = groupsThatAreFamilyDTOAssembler.createDTOFromDomainObject(families); 28 | 29 | //Assert 30 | 31 | assertEquals(families, groupsThatAreFamilyDTO.getGroupThatAreFamily()); 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/PersonSearchAccountRecordsInDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | import com.finance.project.dtos.dtos.PersonSearchAccountRecordsInDTO; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | 9 | class PersonSearchAccountRecordsInDTOAssemblerTest { 10 | 11 | @Test 12 | @DisplayName("Test DTO Constructor") 13 | void constructorTest() { 14 | 15 | // Arrange 16 | String personEmail = "paulo@gmail.com"; 17 | String denominationAccount = "EDP"; 18 | String startDate = "2020-01-05"; 19 | String endDate = "2020-02-10"; 20 | 21 | PersonSearchAccountRecordsInDTO expectedPersonAccountTransactionsWihtinPeriodDTOin = new PersonSearchAccountRecordsInDTO(personEmail, denominationAccount, startDate, endDate); 22 | 23 | // Act 24 | PersonSearchAccountRecordsInDTO assemblerDTOin = PersonSearchAccountRecordsInDTOAssembler.personAccountTransactionsInDTO(personEmail, denominationAccount, startDate, endDate); 25 | 26 | // Assert 27 | assertEquals(expectedPersonAccountTransactionsWihtinPeriodDTOin, assemblerDTOin); 28 | assertEquals(personEmail, assemblerDTOin.getPersonEmail()); 29 | assertEquals(denominationAccount, assemblerDTOin.getAccountDenomination()); 30 | assertEquals(startDate, assemblerDTOin.getStartDate()); 31 | assertEquals(endDate, assemblerDTOin.getEndDate()); 32 | } 33 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/dtos/dtosAssemblers/SiblingsDTOAssemblerTest.java: -------------------------------------------------------------------------------- 1 | package com.finance.project.dtos.dtosAssemblers; 2 | 3 | import com.finance.project.domainLayer.domainEntities.vosShared.PersonID; 4 | import org.junit.jupiter.api.DisplayName; 5 | import org.junit.jupiter.api.Test; 6 | import com.finance.project.dtos.dtos.SiblingsDTO; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | import static org.junit.jupiter.api.Assertions.assertEquals; 12 | 13 | class SiblingsDTOAssemblerTest { 14 | 15 | @Test 16 | @DisplayName("SiblingsDTOssembler - Test create data transfer objects from Domain Object || Happy case") 17 | void siblingsDTOAssembler_CreateDTOFromDomainObjectTest() { 18 | 19 | //Arrange 20 | String emailRui = "rui@gmail.com"; 21 | PersonID idRui = PersonID.createPersonID(emailRui); 22 | String emailhenrique = "henrique@gmail.com"; 23 | PersonID idHenrique = PersonID.createPersonID(emailhenrique); 24 | 25 | List personIDs = new ArrayList<>(); 26 | personIDs.add(idRui); 27 | personIDs.add(idHenrique); 28 | 29 | //Arrange 30 | SiblingsDTOAssembler siblingsDTOAssembler = new SiblingsDTOAssembler(); 31 | SiblingsDTO groupMembersDTO = siblingsDTOAssembler.createDTOFromDomainObject(personIDs); 32 | 33 | //Expected 34 | List persons = new ArrayList<>(); 35 | persons.add(emailRui); 36 | persons.add(emailhenrique); 37 | 38 | SiblingsDTO groupMembersDTOExpected = new SiblingsDTO(persons); 39 | 40 | //Assert 41 | assertEquals(groupMembersDTOExpected, groupMembersDTO); 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /backend/src/test/java/com/finance/project/infrastructureLayer/infrastructureLayer_here.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/backend/src/test/java/com/finance/project/infrastructureLayer/infrastructureLayer_here.txt -------------------------------------------------------------------------------- /diagrams/CD_add_Account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/CD_add_Account.png -------------------------------------------------------------------------------- /diagrams/DDD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/DDD.png -------------------------------------------------------------------------------- /diagrams/DM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/DM.png -------------------------------------------------------------------------------- /diagrams/FURPS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/FURPS.png -------------------------------------------------------------------------------- /diagrams/GOF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/GOF.png -------------------------------------------------------------------------------- /diagrams/GRASP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/GRASP.png -------------------------------------------------------------------------------- /diagrams/SDP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/SDP.png -------------------------------------------------------------------------------- /diagrams/SD_add_Account_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/SD_add_Account_1.png -------------------------------------------------------------------------------- /diagrams/SD_add_Account_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/SD_add_Account_2.png -------------------------------------------------------------------------------- /diagrams/SD_add_Account_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/SD_add_Account_3.png -------------------------------------------------------------------------------- /diagrams/SOLID.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/SOLID.png -------------------------------------------------------------------------------- /diagrams/STUPID.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/STUPID.png -------------------------------------------------------------------------------- /diagrams/analysis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/analysis.png -------------------------------------------------------------------------------- /diagrams/arch_styles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/arch_styles.png -------------------------------------------------------------------------------- /diagrams/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/architecture.png -------------------------------------------------------------------------------- /diagrams/both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/both.png -------------------------------------------------------------------------------- /diagrams/c4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/c4.png -------------------------------------------------------------------------------- /diagrams/categories.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/categories.png -------------------------------------------------------------------------------- /diagrams/combined.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/combined.jpeg -------------------------------------------------------------------------------- /diagrams/ddd_concepts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/ddd_concepts.png -------------------------------------------------------------------------------- /diagrams/earlyEarlySD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/earlyEarlySD.png -------------------------------------------------------------------------------- /diagrams/earlySD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/earlySD.png -------------------------------------------------------------------------------- /diagrams/groupsH2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/groupsH2.png -------------------------------------------------------------------------------- /diagrams/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/home.png -------------------------------------------------------------------------------- /diagrams/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/layers.png -------------------------------------------------------------------------------- /diagrams/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/login.png -------------------------------------------------------------------------------- /diagrams/personsH2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/personsH2.png -------------------------------------------------------------------------------- /diagrams/uml/aggregation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/uml/aggregation.png -------------------------------------------------------------------------------- /diagrams/uml/association.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/uml/association.png -------------------------------------------------------------------------------- /diagrams/uml/composition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/uml/composition.png -------------------------------------------------------------------------------- /diagrams/uml/dependency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/uml/dependency.png -------------------------------------------------------------------------------- /diagrams/uml/encapsulation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/uml/encapsulation.png -------------------------------------------------------------------------------- /diagrams/uml/inheritance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/uml/inheritance.png -------------------------------------------------------------------------------- /diagrams/uml/polymorphism.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/uml/polymorphism.png -------------------------------------------------------------------------------- /diagrams/viewModel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/diagrams/viewModel.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "finalapp", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^4.2.4", 7 | "@testing-library/react": "^9.3.2", 8 | "@testing-library/user-event": "^7.1.2", 9 | "bootstrap": "^4.5.0", 10 | "npm": "^6.14.5", 11 | "react": "^16.13.1", 12 | "react-bootstrap": "^1.0.1", 13 | "react-dom": "^16.13.1", 14 | "react-router-dom": "^5.2.0", 15 | "react-scripts": "3.4.1", 16 | "start": "^5.1.0" 17 | }, 18 | "scripts": { 19 | "start": "react-scripts start", 20 | "build": "react-scripts build", 21 | "test": "react-scripts test", 22 | "eject": "react-scripts eject" 23 | }, 24 | "eslintConfig": { 25 | "extends": "react-app" 26 | }, 27 | "browserslist": { 28 | "production": [ 29 | ">0.2%", 30 | "not dead", 31 | "not op_mini all" 32 | ], 33 | "development": [ 34 | "last 1 chrome version", 35 | "last 1 firefox version", 36 | "last 1 safari version" 37 | ] 38 | }, 39 | "devDependencies": { 40 | "axios": "^0.19.2", 41 | "prop-types": "^15.7.2" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/public/favicon.ico -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intldds/ddd-domain-driven-design/dd3b0ecb23f876297a48f71a0fca1dd3a3266ba8/public/logo512.png -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render } from '@testing-library/react'; 3 | import App from './App'; 4 | 5 | test('renders learn react link', () => { 6 | const { getByText } = render(); 7 | const linkElement = getByText(/learn react/i); 8 | expect(linkElement).toBeInTheDocument(); 9 | }); 10 | -------------------------------------------------------------------------------- /src/context/AppContext.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const AppContext = React.createContext(); 4 | export const {Provider} = AppContext; 5 | export default AppContext; -------------------------------------------------------------------------------- /src/entities/categories/CategoryForm.js: -------------------------------------------------------------------------------- 1 | import React, {useContext, useState} from "react"; 2 | import axios from 'axios'; 3 | import AppContext from "../../context/AppContext"; 4 | import {Api, updateCategories} from "../../context/Actions"; 5 | import Button from "react-bootstrap/Button"; 6 | 7 | const CategoryForm = (props) => { 8 | 9 | const {state, dispatch} = useContext(AppContext) 10 | 11 | const {userID, categories, myPage, myGroups} = state; 12 | const [denomination, setDenomination] = useState(''); 13 | 14 | const handleClick = async (event) => { 15 | const user = userID.toLowerCase(); 16 | 17 | event.preventDefault(); 18 | 19 | if (myPage && !myGroups) { 20 | 21 | try { 22 | await Api.post('/persons/' + user + '/categories/', { 23 | denomination: denomination 24 | }); 25 | 26 | dispatch(updateCategories([...categories.categoriesData, denomination])); 27 | 28 | } catch (err) { 29 | alert(err.response.data.message); 30 | } 31 | } 32 | 33 | if (!myPage && myGroups) { 34 | 35 | try { 36 | await axios.post(props.url, {categoryDenomination: denomination}); 37 | 38 | dispatch(updateCategories([...categories.categoriesData, denomination])); 39 | 40 | } catch (err) { 41 | alert(err.response.data.message); 42 | } 43 | } 44 | setDenomination(''); 45 | } 46 | 47 | return ( 48 |

49 |
50 | 51 | setDenomination(event.target.value)}/> 54 | 55 | 56 |
57 |
58 | ); 59 | }; 60 | 61 | export default CategoryForm; -------------------------------------------------------------------------------- /src/entities/categories/GroupCategories.js: -------------------------------------------------------------------------------- 1 | import React, {useContext} from 'react'; 2 | import AppContext from '../../context/AppContext'; 3 | 4 | function GroupCategories() { 5 | const {state} = useContext(AppContext); 6 | const {groups, categoriesData, accountsData, transactions} = state; 7 | const {transactionsData} = transactions; 8 | const {isLoading, error, groupsData} = groups; 9 | // if (isLoading === true) { 10 | // return (

Loading ....

); 11 | // } 12 | // else { 13 | // if (error !== null) { 14 | // return (

Error ....

); 15 | // } else 16 | if (categoriesData.length > 0) { 17 | return ( 18 |
19 |
20 |
    21 | {categoriesData.map((category) => ( 22 |
  • {category}
  • 23 | ))} 24 |
25 |
26 |
27 | ); 28 | } else { 29 | return (

No data ....

); 30 | } 31 | 32 | } 33 | 34 | export default GroupCategories; -------------------------------------------------------------------------------- /src/entities/groups/EntityGroup.js: -------------------------------------------------------------------------------- 1 | import React, {useContext, useEffect} from "react"; 2 | import axios from 'axios'; 3 | import AppContext from "../../context/AppContext"; 4 | import {fetch_group_started, fetch_group_success, fetch_group_error} from "../../context/Actions"; 5 | import GroupsTable from "../../tables/GroupsTable/GroupsTable"; 6 | import GroupForm from "./GroupForm"; 7 | import MyPage from "../../links/Mypage"; 8 | import User from "../../tables/User/User"; 9 | 10 | function EntityGroup() { 11 | 12 | const {state, dispatch} = useContext(AppContext); 13 | 14 | const {isLogged, groups, userID, username} = state; 15 | 16 | const {isLoading, error, groupsData} = groups; 17 | 18 | useEffect(() => { 19 | if (isLogged == true) { 20 | getGroups(); 21 | } 22 | }, []) 23 | 24 | 25 | // Get User Groups 26 | 27 | const getGroups = async () => { 28 | 29 | const user = userID.toLowerCase(); 30 | 31 | const url = `http://localhost:8080/persons/${user}/groups`; 32 | 33 | dispatch(fetch_group_started()); 34 | 35 | try { 36 | const res = await axios.get(url); 37 | const {data} = await res; 38 | dispatch(fetch_group_success(data.groups)); 39 | } catch (err) { 40 | dispatch(fetch_group_error(err.message)); 41 | } 42 | } 43 | 44 | 45 | // Conditional rendering 46 | 47 | const headers = { 48 | header1: 'Denomination', 49 | header2: 'Description', 50 | header3: 'Date of Creation' 51 | }; 52 | let data; 53 | 54 | if (!isLogged) { 55 | return (

Not logged

); 56 | 57 | } 58 | 59 | if (isLoading == true) { 60 | return (

Loading...

); 61 | } 62 | 63 | if (error.length > 0) { 64 | return (

{error}...

); 65 | } else { 66 | data = 67 | } 68 | 69 | return ( 70 | 71 |
72 | 73 |
74 | {data} 75 | 76 |
77 | ) 78 | 79 | } 80 | 81 | export default EntityGroup; -------------------------------------------------------------------------------- /src/entities/groups/Members/EntityMembers.js: -------------------------------------------------------------------------------- 1 | import React, {useContext, useEffect} from "react"; 2 | import AppContext from "../../../context/AppContext"; 3 | import {Api, fetchMembersError, fetchMembersStarted, fetchMembersSuccess} from "../../../context/Actions"; 4 | import MembersTable from "../../../tables/MembersTable/MembersTable"; 5 | import MembersFrom from "./MembersForm"; 6 | import GroupId from "../../../links/GroupId"; 7 | 8 | function EntityMembers() { 9 | 10 | const {state, dispatch} = useContext(AppContext); 11 | 12 | const {isLogged, groupDenomination, members} = state; 13 | 14 | const {isLoading, error, membersData} = members; 15 | 16 | 17 | useEffect(() => { 18 | if (isLogged == true) { 19 | getAllMembers(); 20 | 21 | } 22 | }, []) 23 | 24 | const getAllMembers = async () => { 25 | 26 | const url = '/groups/' + groupDenomination + '/allMembers'; 27 | 28 | dispatch(fetchMembersStarted()); 29 | 30 | try { 31 | const res = await Api.get(url); 32 | const {data} = res; 33 | dispatch(fetchMembersSuccess(data.allMembers)); 34 | } catch (err) { 35 | dispatch(fetchMembersError(err.message)); 36 | } 37 | }; 38 | 39 | 40 | const headers = { 41 | header1: 'Members', 42 | header2: 'Clearance', 43 | }; 44 | 45 | let data; 46 | 47 | 48 | if (!isLogged) { 49 | return (

Not logged

) 50 | } 51 | 52 | if (isLoading) { 53 | return (

Loading...

); 54 | } 55 | 56 | if (error.length > 0) { 57 | return (

{error}...

); 58 | } else { 59 | data = 60 | } 61 | 62 | return ( 63 |
64 | 65 |
66 | {data} 67 | 68 |
69 | ) 70 | 71 | } 72 | 73 | export default EntityMembers; -------------------------------------------------------------------------------- /src/entities/groups/Members/MembersForm.js: -------------------------------------------------------------------------------- 1 | import React, {useContext, useState} from "react"; 2 | import AppContext from "../../../context/AppContext"; 3 | import {Api, updateMembers} from "../../../context/Actions"; 4 | import Button from "react-bootstrap/Button"; 5 | 6 | const MembersFrom = () => { 7 | 8 | const {state, dispatch} = useContext(AppContext); 9 | 10 | const {groupDenomination, members} = state; 11 | const {membersData} = members; 12 | 13 | const [memberID, setMemberID] = useState(''); 14 | 15 | // Clearance 16 | 17 | const [clearance, setClearance] = useState("member"); 18 | 19 | 20 | const handleClick = (event) => { 21 | 22 | event.preventDefault(); 23 | 24 | Api.post('/groups/' + groupDenomination + '/members', { 25 | email: memberID 26 | }).then(response => { 27 | dispatch(updateMembers([...membersData, {memberID, clearance}])); 28 | }) 29 | .catch(err => alert(err.response.data.message)); 30 | setMemberID(''); 31 | } 32 | 33 | return ( 34 |
35 |
36 | setMemberID(event.target.value)}/> 39 | 40 |
41 |
42 | ); 43 | } 44 | 45 | export default MembersFrom -------------------------------------------------------------------------------- /src/entities/ledgers/LedgerGroup.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import EntityLedgers from "./EntityLedgers"; 3 | 4 | 5 | function LedgerGroup (){ 6 | return ( 7 |
8 | 9 | 10 | 11 |
12 | ) 13 | } 14 | 15 | export default LedgerGroup; -------------------------------------------------------------------------------- /src/entities/members/Members.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from "react"; 2 | import axios from 'axios'; 3 | import Table from "../tables/Table"; 4 | 5 | const api = axios.create({ 6 | baseURL: 'http://localhost:8080/' 7 | }) 8 | 9 | class Members extends Component { 10 | state = { 11 | members: [] 12 | } 13 | 14 | constructor() { 15 | super(); 16 | this.getAllMembers() 17 | } 18 | 19 | 20 | } -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom' 3 | import './index.css'; 4 | import App from './App'; 5 | import * as serviceWorker from './serviceWorker'; 6 | import AppProvider from './context/AppProvider'; 7 | 8 | ReactDOM.render( 9 | 10 | 11 | 12 | 13 | , 14 | document.getElementById('root') 15 | ); 16 | 17 | // If you want your app to work offline and load faster, you can change 18 | // unregister() to register() below. Note this comes with some pitfalls. 19 | // Learn more about service workers: https://bit.ly/CRA-PWA 20 | serviceWorker.unregister(); 21 | -------------------------------------------------------------------------------- /src/links/Accounts.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import EntityAccount from '../entities/accounts/EntityAccount'; 3 | 4 | function Accounts() { 5 | 6 | return ( 7 |
8 | 9 |
10 | ) 11 | 12 | } 13 | 14 | export default Accounts; -------------------------------------------------------------------------------- /src/links/AdminsGroup.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | 4 | function AdminsGroup (){ 5 | return ( 6 |
7 |

Group admins

8 | 9 |

Insert group admins table.

10 | 11 |
12 | ) 13 | } 14 | 15 | export default AdminsGroup; -------------------------------------------------------------------------------- /src/links/Categories.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import EntityCategory from "../entities/categories/EntityCategory"; 3 | 4 | 5 | function Categories (){ 6 | return ( 7 |
8 | 9 |
10 | ) 11 | } 12 | 13 | export default Categories; -------------------------------------------------------------------------------- /src/links/Home.js: -------------------------------------------------------------------------------- 1 | import React, {useContext} from 'react'; 2 | import AppContext from "../context/AppContext"; 3 | import MyPage from "./Mypage"; 4 | 5 | function Home() { 6 | 7 | const {state} = useContext(AppContext); 8 | 9 | const {isLogged} = state; 10 | 11 | if (isLogged === true) { 12 | return ( 13 |
14 |
    15 | 16 |
17 |
18 | 19 | 20 | ); 21 | } 22 | 23 | } 24 | 25 | export default Home; -------------------------------------------------------------------------------- /src/links/Ledger.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import EntityLedgers from "../entities/ledgers/EntityLedgers"; 3 | 4 | function Ledger () { 5 | return( 6 | 7 |
8 | 9 |
10 | ) 11 | } 12 | 13 | export default EntityLedgers; -------------------------------------------------------------------------------- /src/links/Login.js: -------------------------------------------------------------------------------- 1 | import React, {useState} from 'react'; 2 | import {useHistory} from 'react-router-dom'; 3 | import AppContext from '../context/AppContext'; 4 | import Form from "react-bootstrap/Form"; 5 | import Button from "react-bootstrap/Button"; 6 | 7 | import {Api, login} from '../context/Actions'; 8 | 9 | const Login = () => { 10 | const {dispatch} = React.useContext(AppContext); 11 | 12 | let history = useHistory(); 13 | 14 | const [userID, setUserID] = useState(''); 15 | 16 | const handleClick = async (e) => { 17 | e.preventDefault(); 18 | 19 | const url = '/persons/' + userID; 20 | 21 | const array = userID.toLowerCase().split("@"); 22 | const username = array[0]; 23 | 24 | try { 25 | const res = await Api.get(url); 26 | if (res.status === 200) { 27 | dispatch(login(userID, username)); 28 | history.push("/mypage"); 29 | } 30 | } catch (err) { 31 | alert(err.response.data.message); 32 | } 33 | } 34 | 35 | return ( 36 |
37 | 38 |
39 | 40 |
41 |

Web App with React

42 |

Personal Finance Management

43 | 44 | Username 45 | setUserID(e.target.value)}/> 46 | 47 | 48 | 49 | Password 50 | 51 | 52 |

53 | 54 |
55 | 56 |
57 | 58 |
59 | ); 60 | }; 61 | 62 | export default Login; 63 | -------------------------------------------------------------------------------- /src/links/Logout.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { useHistory } from 'react-router-dom'; 3 | import AppContext from '../context/AppContext'; 4 | import {logout} from '../context/Actions'; 5 | import Button from "react-bootstrap/Button"; 6 | 7 | function Logout () { 8 | const {dispatch} = React.useContext(AppContext); 9 | let history = useHistory(); 10 | const handleClick = () => { 11 | window.location.href = '/'; 12 | dispatch(logout()); 13 | } 14 | 15 | return ( 16 | 17 | ); 18 | 19 | } 20 | 21 | export default Logout; -------------------------------------------------------------------------------- /src/links/MembersGroup.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import EntityMembers from "../entities/groups/Members/EntityMembers"; 3 | 4 | 5 | function MembersGroup (){ 6 | return ( 7 |
8 | 9 |
10 | ) 11 | 12 | } 13 | 14 | export default MembersGroup; -------------------------------------------------------------------------------- /src/links/MyGroups.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import EntityGroup from "../entities/groups/EntityGroup"; 3 | import User from "../tables/User/User"; 4 | 5 | function MyGroups () { 6 | 7 | return ( 8 |
9 | 10 |
11 | ) 12 | 13 | } 14 | export default MyGroups; -------------------------------------------------------------------------------- /src/links/NoRoute.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Redirect } from 'react-router-dom'; 3 | import AppContext from '../context/AppContext'; 4 | import {logout} from '../context/Actions' 5 | 6 | function NoRoute() { 7 | 8 | const {dispatch} = React.useContext(AppContext); 9 | React.useEffect(() =>{ 10 | dispatch(logout()); 11 | }); 12 | return( 13 | 14 | ); 15 | } 16 | 17 | export default NoRoute; -------------------------------------------------------------------------------- /src/links/PrivateRoute.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Route, Redirect } from 'react-router-dom'; 3 | import AppContext from '../context/AppContext'; 4 | 5 | /* 6 | { component: XPTO, ...rest } 7 | component: XPTO : Find the component property defined on props (Note: lowercase component) and assign it to a new location in state we call XPTO 8 | ...rest: Then, take all remaining properties defined on the props object and collect them inside an argument called rest. 9 | */ 10 | 11 | function PrivateRoute({ component: XPTO, ...rest }) { 12 | const {state} = React.useContext(AppContext); 13 | const {isLogged} = state; 14 | return( 15 | ( 16 | isLogged 17 | ? () 18 | : () )} 19 | /> 20 | ); 21 | } 22 | 23 | export default PrivateRoute; -------------------------------------------------------------------------------- /src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom/extend-expect'; 6 | -------------------------------------------------------------------------------- /src/tables/AccountsTable/AccountsTable.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | import TableHeader from './TableHeader'; 3 | import TableBody from './TableBody'; 4 | import Table from "react-bootstrap/Table"; 5 | 6 | class AccountsTable extends Component { 7 | 8 | render() { 9 | const headers = this.props.headers; 10 | 11 | console.log ({headers}) 12 | const data = this.props.data; 13 | 14 | return ( 15 | 16 | 17 | 18 |
19 | ); 20 | } 21 | } 22 | 23 | export default AccountsTable; -------------------------------------------------------------------------------- /src/tables/AccountsTable/TableBody.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | 3 | class TableBody extends Component { 4 | 5 | render() { 6 | const {data} = this.props; 7 | 8 | const rows = data.map( 9 | (row, index) => 10 | 11 | {row.denomination} 12 | {row.description} 13 | 14 | ); 15 | 16 | return ( 17 | {rows} 18 | ); 19 | } 20 | } 21 | 22 | export default TableBody; -------------------------------------------------------------------------------- /src/tables/AccountsTable/TableHeader.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | 3 | class TableHeader extends Component { 4 | 5 | render() { 6 | const {headers} = this.props; 7 | return ( 8 | 9 | 10 | 11 | {headers.header1} 12 | {headers.header2} 13 | 14 | 15 | ); 16 | } 17 | } 18 | 19 | export default TableHeader; -------------------------------------------------------------------------------- /src/tables/CategoriesTable/CategoriesTable.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import CategoriesTableHeader from './CategoriesTableHeader'; 3 | import CategoriesTableBody from './CategoriesTableBody'; 4 | import Table from "react-bootstrap/Table"; 5 | class CategoriesTable extends Component { 6 | 7 | render() { 8 | const headers = this.props.headers; 9 | 10 | console.log({headers}) 11 | const data = this.props.data; 12 | 13 | return ( 14 | 15 | 16 | 17 |
18 | ); 19 | } 20 | } 21 | export default CategoriesTable; -------------------------------------------------------------------------------- /src/tables/CategoriesTable/CategoriesTableBody.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | 3 | class CategoriesTableBody extends Component { 4 | 5 | render() { 6 | const {data} = this.props; // data = this.props.data; 7 | 8 | const rows = data.map( 9 | (row, index) => 10 | 11 | {row} 12 | 13 | ) 14 | 15 | return ( 16 | {rows} 17 | ); 18 | } 19 | } 20 | 21 | export default CategoriesTableBody; 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/tables/CategoriesTable/CategoriesTableHeader.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | 3 | class CategoriesTableHeader extends Component { 4 | 5 | render() { 6 | const {headers} = this.props; 7 | return ( 8 | 9 | 10 | {headers.header1} 11 | 12 | 13 | ); 14 | } 15 | } 16 | 17 | export default CategoriesTableHeader; -------------------------------------------------------------------------------- /src/tables/GroupsTable/GroupsTable.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import TableBody from "./TableBody"; 3 | import TableHeader from "./TableHeader"; 4 | import Table from "react-bootstrap/Table"; 5 | 6 | class GroupsTable extends Component { 7 | 8 | constructor(props) { 9 | super(props); 10 | } 11 | render() { 12 | const headers = this.props.headers; 13 | 14 | console.log({headers}) 15 | const data = this.props.data; 16 | 17 | return ( 18 | 19 | 20 | 21 |
22 | ); 23 | } 24 | } 25 | 26 | export default GroupsTable; -------------------------------------------------------------------------------- /src/tables/GroupsTable/TableBody.js: -------------------------------------------------------------------------------- 1 | import React, {useContext} from 'react'; 2 | import AppContext from "../../context/AppContext"; 3 | import {useHistory} from 'react-router-dom'; 4 | import {setGroupDenomination} from "../../context/Actions"; 5 | 6 | function GroupsTableBody() { 7 | const {state, dispatch} = useContext(AppContext); 8 | const {groups} = state; 9 | 10 | const {groupsData} = groups; 11 | 12 | let history = useHistory(); 13 | 14 | const handleOnClick = (denomination) => { 15 | 16 | dispatch(setGroupDenomination(denomination)); 17 | 18 | history.push("/myGroups/" + denomination) 19 | } 20 | 21 | const rows = groupsData.map((row, index) => { 22 | 23 | return ( 24 | 25 | handleOnClick(row.denomination)}>{row.denomination} 26 | {row.description} 27 | {row.dateOfCreation} 28 | 29 | 30 | ) 31 | }); 32 | return ( 33 | 34 | {rows} 35 | ); 36 | } 37 | 38 | export default GroupsTableBody; -------------------------------------------------------------------------------- /src/tables/GroupsTable/TableHeader.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | 3 | class TableHeader extends Component { 4 | constructor(props) { 5 | super(props); 6 | } 7 | 8 | render() { 9 | const {headers} = this.props; 10 | return ( 11 | 12 | 13 | {headers.header1} 14 | {headers.header2} 15 | {headers.header3} 16 | 17 | 18 | ); 19 | } 20 | } 21 | 22 | export default TableHeader; -------------------------------------------------------------------------------- /src/tables/LedgersTable/LedgerTable.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import LedgerTableBody from "./LedgerTableBody"; 3 | import LedgerTableHeader from "./LedgerTableHeader"; 4 | import Table from "react-bootstrap/Table"; 5 | 6 | class LedgerTable extends Component { 7 | 8 | constructor(props) { 9 | super(props); 10 | } 11 | 12 | render() { 13 | 14 | const headers = this.props.headers; 15 | const data = this.props.data; 16 | 17 | return ( 18 | //
19 | 20 | {/*
*/} 21 | 22 | {/*
*/} 23 |
24 | 25 |
26 |
27 | 28 | ); 29 | } 30 | } 31 | export default LedgerTable -------------------------------------------------------------------------------- /src/tables/LedgersTable/LedgerTableHeader.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | 3 | class LedgerTableHeader extends Component { 4 | constructor(props) { 5 | super(props); 6 | } 7 | 8 | render() { 9 | const {headers} = this.props; 10 | return ( 11 |
12 | 13 | 14 | 15 | {headers.header1} 16 | {headers.header2} 17 | {headers.header3} 18 | {headers.header4} 19 | {headers.header5} 20 | {headers.header6} 21 | {headers.header7} 22 | {headers.header8} 23 | 24 | 25 | 26 |
27 | ); 28 | } 29 | } 30 | 31 | export default LedgerTableHeader; -------------------------------------------------------------------------------- /src/tables/MembersTable/MembersTable.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from "react"; 2 | import MembersTableHeader from "./MembersTableHeader"; 3 | import MembersTableBody from "./MembersTableBody"; 4 | import Table from "react-bootstrap/Table"; 5 | 6 | 7 | class MembersTable extends Component { 8 | 9 | constructor(props) { 10 | super(props); 11 | } 12 | 13 | render() { 14 | const headers = this.props.headers; 15 | const data = this.props.data; 16 | 17 | return ( 18 | 19 | 20 | 21 |
22 | ); 23 | } 24 | 25 | } 26 | 27 | export default MembersTable -------------------------------------------------------------------------------- /src/tables/MembersTable/MembersTableBody.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | 3 | class MembersTableBody extends Component { 4 | constructor(props) { 5 | super(props); 6 | } 7 | 8 | render() { 9 | const {data} = this.props; 10 | 11 | const rows = data.map( 12 | (row, index) => 13 | 14 | {row.memberID} 15 | {row.clearance} 16 | 17 | 18 | ); 19 | 20 | return ( 21 | {rows} 22 | ); 23 | } 24 | } 25 | 26 | export default MembersTableBody -------------------------------------------------------------------------------- /src/tables/MembersTable/MembersTableHeader.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | 3 | class MembersTableHeader extends Component { 4 | 5 | constructor(props) { 6 | super(props); 7 | } 8 | 9 | render() { 10 | const {headers} = this.props; 11 | return ( 12 | 13 | 14 | {headers.header1} 15 | {headers.header2} 16 | 17 | 18 | ); 19 | } 20 | } 21 | 22 | export default MembersTableHeader; -------------------------------------------------------------------------------- /src/tables/User/User.js: -------------------------------------------------------------------------------- 1 | import React, {Component, useContext, useState} from "react"; 2 | import axios from 'axios'; 3 | import AppContext from "../../context/AppContext"; 4 | 5 | 6 | const api = axios.create({ 7 | baseURL: 'http://localhost:8080' 8 | }) 9 | 10 | function User() { 11 | const {state, dispatch} = useContext(AppContext); 12 | const {user} = state; 13 | 14 | return ( 15 |

{user}

16 | ) 17 | } 18 | export default User 19 | --------------------------------------------------------------------------------