-
Notifications
You must be signed in to change notification settings - Fork 571
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
refactor(apiv1): accounts api #825
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #825 +/- ##
==========================================
+ Coverage 34.64% 39.15% +4.51%
==========================================
Files 61 65 +4
Lines 5499 5782 +283
==========================================
+ Hits 1905 2264 +359
+ Misses 3359 3243 -116
- Partials 235 275 +40 ☔ View full report in Codecov by Sentry. |
cfe1345
to
0835804
Compare
…aywright test helper
Hi after a long time :) |
Yeah still working on the PR and the E2E tests :) |
AccountsDomain
toAuthDomain
to handle authentication logic in a separate layer.AccountsDomain
which contains logic related to managing Accounts and is the layer that communicates with teh database.AccountDTO
object.Account
is the exact database representation of the row,AccountDTO
is the object we can transfer around in the rest of the code with more fields, helper methods, etc. Is also the object used in creates/updates for the Accounts with included validation.Account
usages around the code to beAccountDTO
.Database
interface changes:Database.ListAccounts
(formerlyDatabase.GetAccounts
). UsingList*
to better differentiate between the method that return one account and the one that return many.ListAccountOptions
to filter by keyword, username and owner. Also allows retrieving the password field which is disabled by default.DeleteAccount
replacesDeleteAccounts
. Now only deletes one account, iteration logic moved to theAccountsDomain
.SaveAccount
is not calledCreateAccount
AdminRequired
/api/v1/auth/account
to allow updating the entire user data, not only the settings. This should be backwards compatible.model.Ptr
helper that return an object as a pointer of itselfValidationError
error type to return directly from domains and have details available to expose to the API.NewAdminUser
andoptions.WithAuthToken
to avoid boilerplate in tests.Closes #657