Skip to content

feat: Add account endpoints create, findAll, findById, delete and upd…#32

Merged
felipemelozx merged 6 commits intodevelopfrom
feat/account-crud
May 16, 2025
Merged

feat: Add account endpoints create, findAll, findById, delete and upd…#32
felipemelozx merged 6 commits intodevelopfrom
feat/account-crud

Conversation

@felipemelozx
Copy link
Owner

@felipemelozx felipemelozx commented May 15, 2025

Pull Request Description

Implementation of REST endpoints for the Account entity, including create, list all, find by ID, update, and delete operations.

Related Task

#28

What was done?

  • Created endpoints in AccountController for CRUD operations: createAccount, findAllAccounts, findAccountById, updateAccountById, and deleteAccountById.
  • Implemented DTOs: AccountRequestDTO, AccountResponseDTO, and AccountUpdateRequestDTO.
  • Added the isAccountDefault field to the AccountEntity.
  • Created mapping between entities and DTOs using MapStruct (AccountMapper).
  • Developed AccountService with business logic, including integration with UserService for user association.
  • Created JPA repository AccountRepository.

Tests

  • I tested all endpoints locally using Postman/Insomnia.
  • Unit tests.

How to Test

  1. Run the Spring Boot application.
  2. Use tools like Postman to:
    • Create an account (POST /accounts).
    • List all accounts (GET /accounts).
    • Find an account by ID (GET /accounts/{id}).
    • Update an account by ID (PUT /accounts/{id}).
    • Delete an account by ID (DELETE /accounts/{id}).
  3. Verify the responses and HTTP status codes to validate functionality.

Dependencies

  • UserService must be functional to associate users with accounts.
  • MapStruct must be configured for the mappings.
  • Database must be set up with the account table.

@felipemelozx felipemelozx self-assigned this May 15, 2025
@felipemelozx felipemelozx changed the base branch from main to develop May 15, 2025 19:51
@sonarqubecloud
Copy link

@felipemelozx felipemelozx merged commit c5f58fe into develop May 16, 2025
5 checks passed
@felipemelozx felipemelozx deleted the feat/account-crud branch May 16, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant