Assign users to roles via role_user and drop unused social media and light-mode fields.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
guwandykandCursor committed 2026-08-18 11:13:53 +05:00
1 parent 514b9ca5fc
commit 0788585c0e
6 files changed
+119 -143

No files matched your search

+32 -44
View File
@@ -2,12 +2,6 @@ package user
import "time"
type SocialMedia struct {
Facebook string `json:"facebook"`
Instagram string `json:"instagram"`
Telegram string `json:"telegram"`
}
type LocalizedText struct {
En string `json:"en"`
Ru string `json:"ru"`
@@ -21,50 +15,44 @@ type StaffBranchDTO struct {
}
type UserDTO struct {
Id int64 `json:"id"`
Email string `json:"email"`
Name string `json:"name"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Username string `json:"username"`
Phone string `json:"phone"`
Avatar string `json:"avatar"`
SocialMedia SocialMedia `json:"socialMedia"`
LightMode int `json:"lightMode"`
Role string `json:"role"`
Active bool `json:"active"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Branches []StaffBranchDTO `json:"branches,omitempty"`
Id int64 `json:"id"`
Email string `json:"email"`
Name string `json:"name"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Username string `json:"username"`
Phone string `json:"phone"`
Avatar string `json:"avatar"`
Role string `json:"role"`
Active bool `json:"active"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Branches []StaffBranchDTO `json:"branches,omitempty"`
}
type CreateUserDTO struct {
Email string `json:"email" binding:"required"`
Password string `json:"password" binding:"required"`
Name string `json:"name" binding:"required"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Username string `json:"username" binding:"required"`
Phone string `json:"phone"`
Avatar string `json:"avatar"`
SocialMedia SocialMedia `json:"socialMedia"`
LightMode int `json:"lightMode"`
Role string `json:"role"`
Active *bool `json:"active"`
Email string `json:"email" binding:"required"`
Password string `json:"password" binding:"required"`
Name string `json:"name" binding:"required"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Username string `json:"username" binding:"required"`
Phone string `json:"phone"`
Avatar string `json:"avatar"`
Role string `json:"role"`
Active *bool `json:"active"`
}
type UpdateUserDTO struct {
Email string `json:"email" binding:"required"`
Name string `json:"name" binding:"required"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Username string `json:"username" binding:"required"`
Phone string `json:"phone"`
Avatar string `json:"avatar"`
SocialMedia SocialMedia `json:"socialMedia"`
LightMode int `json:"lightMode"`
Role string `json:"role"`
Active bool `json:"active"`
Email string `json:"email" binding:"required"`
Name string `json:"name" binding:"required"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Username string `json:"username" binding:"required"`
Phone string `json:"phone"`
Avatar string `json:"avatar"`
Role string `json:"role"`
Active bool `json:"active"`
}
type ListFilter struct {