Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
feat: Add structs Notification and Show into UserUpdate DTO
Browse files Browse the repository at this point in the history
  • Loading branch information
devkcud committed Jul 16, 2024
1 parent a88ef03 commit 460b37c
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions internal/model/dto/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,23 @@ type UserUpdate struct {
Email string `validate:"omitempty,email" json:"email"`
Password string `validate:"omitempty,password,min=12,max=48" json:"password"`

// NOTE: Notification and Show structs will be in another method/route to update
// due to the nature of structs being a pain in the ass to work with :/
Notification struct {
InApp int `validate:"omitempty,mustbenumericalboolean" json:"inapp"`
Email int `validate:"omitempty,mustbenumericalboolean" json:"email"`
} `validate:"omitempty,dive" json:"notify" gorm:"embedded;embeddedPrefix:notify_"`

Show struct {
Profile int `validate:"omitempty,mustbenumericalboolean" json:"profile"`
Image int `validate:"omitempty,mustbenumericalboolean" json:"image"`
Comments int `validate:"omitempty,mustbenumericalboolean" json:"comments"`
Favorites int `validate:"omitempty,mustbenumericalboolean" json:"favorites"`
Projects int `validate:"omitempty,mustbenumericalboolean" json:"projects"`
Components int `validate:"omitempty,mustbenumericalboolean" json:"components"`
Followers int `validate:"omitempty,mustbenumericalboolean" json:"followers"`
Following int `validate:"omitempty,mustbenumericalboolean" json:"following"`
Inventory int `validate:"omitempty,mustbenumericalboolean" json:"inventory"`
Formations int `validate:"omitempty,mustbenumericalboolean" json:"formations"`
} `validate:"omitempty,dive" gorm:"embedded;embeddedPrefix:show_"`

Country string `validate:"omitempty" json:"country"`

Expand Down

0 comments on commit 460b37c

Please sign in to comment.