Add callback and update user role
This commit is contained in:
@@ -21,6 +21,7 @@ type User struct {
|
||||
RoleID role.Role
|
||||
RoleName string
|
||||
PartnerID *int64
|
||||
SiteID *int64
|
||||
PartnerName string
|
||||
}
|
||||
|
||||
@@ -39,6 +40,7 @@ type UserRoleDB struct {
|
||||
UserID int64 `gorm:"column:user_id"`
|
||||
RoleID int64 `gorm:"column:role_id"`
|
||||
PartnerID *int64 `gorm:"column:partner_id"`
|
||||
SiteID *int64 `gorm:"column:site_id"`
|
||||
CreatedAt time.Time `gorm:"column:created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at"`
|
||||
}
|
||||
@@ -66,6 +68,7 @@ func (u *User) ToUserDB(createdBy int64) (*UserDB, error) {
|
||||
PartnerID: u.PartnerID,
|
||||
Status: userstatus.Active,
|
||||
CreatedBy: createdBy,
|
||||
SiteID: u.SiteID,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user