Skip to content

Commit

Permalink
feat: Use UUID v7 as default
Browse files Browse the repository at this point in the history
  • Loading branch information
hlubek committed Oct 22, 2024
1 parent 8537b95 commit 2d4a077
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions backend/domain/command/account_create_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ type AccountCreateCmd struct {
}

func NewAccountCreateCmd(emailAddress string, role types.Role, password string) (cmd AccountCreateCmd, err error) {
accountID, err := uuid.NewV4()
accountID, err := uuid.NewV7()
if err != nil {
return cmd, errors.Wrap(err, "generate account id")
return cmd, errors.Wrap(err, "generating id")
}

return AccountCreateCmd{
Expand Down Expand Up @@ -72,7 +72,7 @@ func (c AccountCreateCmd) Validate(_ domain.Config) error {
func (c AccountCreateCmd) NewAccount(config domain.Config) (model.Account, error) {
accountSecret, err := model.NewAccountSecret()
if err != nil {
return model.Account{}, errors.Wrap(err, "generate account secret")
return model.Account{}, errors.Wrap(err, "generating account secret")
}
passwordHash, err := helper.GenerateHashFromPassword([]byte(c.password), config.HashCost)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion backend/domain/command/organisation_create_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type OrganisationCreateCmd struct {
}

func NewOrganisationCreateCmd() (cmd OrganisationCreateCmd, err error) {
organisationID, err := uuid.NewV4()
organisationID, err := uuid.NewV7()
if err != nil {
return cmd, errors.Wrap(err, "generating id")
}
Expand Down

0 comments on commit 2d4a077

Please sign in to comment.