Skip to content

Commit

Permalink
refactor: consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinntas committed Apr 29, 2024
1 parent 5eae3a5 commit f46c1af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
19 changes: 9 additions & 10 deletions api/shared/domain/shared.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package sharedDomain

import (
"time"

"github.com/quinntas/go-rest-template/internal/api/types"
)

Expand All @@ -13,15 +11,16 @@ type SharedDomain struct {
UpdatedAt types.Date `json:"updatedAt" `
}

func NewSharedDomain(id int,
pid string,
createdAt time.Time,
updatedAt time.Time,
func NewSharedDomain(
id types.ID,
pid types.UUID,
createdAt types.Date,
updatedAt types.Date,
) SharedDomain {
return SharedDomain{
ID: types.NewID(id),
PID: types.NewUUID(pid),
CreatedAt: types.NewDate(createdAt),
UpdatedAt: types.NewDate(updatedAt),
ID: id,
PID: pid,
CreatedAt: createdAt,
UpdatedAt: updatedAt,
}
}
7 changes: 1 addition & 6 deletions api/user/domain/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@ func NewUserDomain(
roleId types.ID,
) UserDomain {
return UserDomain{
sharedDomain.SharedDomain{
ID: id,
PID: pid,
CreatedAt: createdAt,
UpdatedAt: updatedAt,
},
sharedDomain.NewSharedDomain(id, pid, createdAt, updatedAt),
email,
password,
roleId,
Expand Down

0 comments on commit f46c1af

Please sign in to comment.