-
Notifications
You must be signed in to change notification settings - Fork 21
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: changed transaction handling related to Account package #1508
Conversation
eac85c2
to
475aec4
Compare
pkg/account/api/account.go
Outdated
return s.auditlogStorage.CreateAuditLog( | ||
contextWithTx, | ||
domainauditlog.NewAuditLog(createAccountEvent, storage.AdminEnvironmentID), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cre8ivejp
I tried implementing support for updating AuditLog within the same transaction.
Supporting NoCommand like this will generate an Event, so it would be a good idea to update AuditLog based on that.
Please check when you are free.
@@ -78,6 +78,56 @@ func (h *autoOpsRuleCommandHandler) Handle(ctx context.Context, cmd Command) err | |||
return errUnknownCommand | |||
} | |||
|
|||
// func (h *autoOpsRuleCommandHandler) NewEvent(ctx context.Context, cmd Command) (*eventproto.Event, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can delete this directly.
createAccountEvent, err = domainevent.NewEvent( | ||
createAccountEvent, err = domainevent.NewAdminEvent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cre8ivejp
Check the code below I think the Account-related AuditLog
needs to be saved in AdminAuditLog
, so I made some changes.
https://github.com/bucketeer-io/bucketeer/blob/main/pkg/account/command/account_v2.go#L372
@kakcy, please fix the conflict. |
a5573ff
to
453174a
Compare
@cre8ivejp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
This pull request includes significant changes to the
pkg/account/api/account.go
file, focusing on updating transaction handling and integrating audit log creation. Additionally, it includes corresponding updates to the test filepkg/account/api/account_test.go
.Part of #1474
Part of #1002