Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Implement PUT /v1/accounts/:address/data-settings #1715

Merged
merged 29 commits into from
Jul 9, 2024

Conversation

hectorgomezv
Copy link
Member

@hectorgomezv hectorgomezv commented Jul 2, 2024

Depends on #1735

Summary

This PR adds the endpoint:

PUT /v1/accounts/:address/data-settings
  • The endpoint expects a UpsertAccountDataSettingsDto request body with the following payload:
{
  "accountDataSettings": [
    {
      "id": [string],
      "enabled": [boolean]
    },
    {
      "id": [string],
      "enabled": [boolean]
    },
    ...
}
  • The endpoint is authenticated using SIWE, so an accessToken associated with the address included in the URL needs to be provided. Otherwise, a 403 status will be returned.

Changes

  • The endpoint PUT /v1/accounts/:address/data-settings was added to AccountsController, protected by AuthGuard.
  • Associated tests and domain classes were added.

@hectorgomezv hectorgomezv self-assigned this Jul 2, 2024
@hectorgomezv hectorgomezv changed the title Implement /v1/accounts/:address/data-settings Implement PUT /v1/accounts/:address/data-settings Jul 5, 2024
@safe-global safe-global deleted a comment from coveralls Jul 8, 2024
@safe-global safe-global deleted a comment from coveralls Jul 8, 2024
@safe-global safe-global deleted a comment from coveralls Jul 8, 2024
@safe-global safe-global deleted a comment from coveralls Jul 8, 2024
@safe-global safe-global deleted a comment from coveralls Jul 8, 2024
@safe-global safe-global deleted a comment from coveralls Jul 8, 2024
@safe-global safe-global deleted a comment from coveralls Jul 8, 2024
@coveralls
Copy link

coveralls commented Jul 8, 2024

Pull Request Test Coverage Report for Build 9855726191

Details

  • 22 of 58 (37.93%) changed or added relevant lines in 9 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.1%) to 48.144%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/domain/accounts/entities/upsert-account-data-settings.dto.entity.ts 5 6 83.33%
src/routes/accounts/accounts.controller.ts 6 7 85.71%
src/routes/accounts/entities/account-data-type.entity.ts 0 1 0.0%
src/routes/accounts/entities/account-data-setting.entity.ts 5 8 62.5%
src/domain/accounts/accounts.repository.ts 0 6 0.0%
src/routes/accounts/accounts.service.ts 0 8 0.0%
src/datasources/accounts/accounts.datasource.ts 0 16 0.0%
Files with Coverage Reduction New Missed Lines %
src/domain/accounts/accounts.repository.ts 1 12.12%
src/datasources/accounts/accounts.datasource.ts 1 10.64%
Totals Coverage Status
Change from base Build 9852343752: -0.1%
Covered Lines: 4244
Relevant Lines: 7076

💛 - Coveralls

@hectorgomezv hectorgomezv marked this pull request as ready for review July 8, 2024 09:48
@hectorgomezv hectorgomezv requested a review from a team as a code owner July 8, 2024 09:48
@hectorgomezv hectorgomezv changed the base branch from main to fix-test-db-race-conditions July 8, 2024 10:00
@hectorgomezv hectorgomezv marked this pull request as draft July 8, 2024 13:46
Base automatically changed from fix-test-db-race-conditions to main July 8, 2024 13:49
@hectorgomezv hectorgomezv marked this pull request as ready for review July 8, 2024 16:41
Copy link
Member

@iamacook iamacook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work! 🚀🚀🚀

@hectorgomezv hectorgomezv merged commit b81b046 into main Jul 9, 2024
16 checks passed
@hectorgomezv hectorgomezv deleted the add-account-data-settings branch July 9, 2024 14:20
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.

3 participants