Compare commits

..

No commits in common. "642566c8b2ce4573de30b87a078beb838f0b0e8a" and "20c9660c3a67e6b5b6237accb03aafe226b10a27" have entirely different histories.

6 changed files with 27 additions and 37 deletions

View File

@ -6,8 +6,7 @@ import (
type Staff struct {
ID string `gorm:"primaryKey" json:"id"`
Name string `gorm:"default:null;unique" json:"name"`
ProfilePicture string `gorm:"default:null" json:"profile_picture"`
Username string `gorm:"default:null;unique" json:"username"`
Email string `gorm:"unique;not null" json:"email"`
Password string `gorm:"not null" json:"password"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`

View File

@ -19,8 +19,7 @@ type LoginRepoResponse struct {
type StaffProfile struct {
ID string `json:"id"`
Email string `json:"email"`
Name string `json:"name"`
ProfilePicture string `json:"profile_picture"`
Username string `json:"username"`
}
type UserProfile struct {

View File

@ -18,20 +18,18 @@ type User struct {
type RegisterStaffReq struct {
Email string `json:"email" validate:"required"`
Password string `json:"password" validate:"required"`
Name string `json:"name" validate:"required"`
ProfilePicture string `json:"profile_picture"`
Username string `json:"username" validate:"required"`
}
type UpdateStaffReq struct {
Email string `json:"email"`
Password string `json:"password"`
Name string `json:"name"`
Username string `json:"username"`
}
type Staff struct {
ID string `json:"id"`
Email string `json:"email"`
Password string `json:"password"`
Name string `json:"name"`
ProfilePicture string `json:"profile_picture"`
Username string `json:"username"`
}

View File

@ -10,9 +10,8 @@ func (as *AuthSvc) GetStaffProfile(email string) (*authdomain.StaffProfile, erro
profile := &authdomain.StaffProfile{
ID: staff.ID,
Name: staff.Name,
Username: staff.Username,
Email: staff.Email,
ProfilePicture: staff.ProfilePicture,
}
return profile, nil

View File

@ -23,8 +23,7 @@ func (a *AuthSvc) RegisterStaff(spec authdomain.RegisterStaffReq) (string, error
ID: uuid.NewString(),
Email: spec.Email,
Password: hashedPwd,
Name: spec.Name,
ProfilePicture: spec.ProfilePicture,
Username: spec.Username,
}
_, err = a.staffRepo.Create(&staff)

View File

@ -25,9 +25,7 @@ paths:
type: string
email:
type: string
name:
type: string
profile_picture:
username:
type: string
"400":
description: Bad request
@ -110,14 +108,12 @@ paths:
format: email
password:
type: string
name:
type: string
profile_picture:
username:
type: string
required:
- email
- password
- name
- username
responses:
"201":
description: Staff member created