Introduces a branch_user join table linking branches to users, plus create/delete API endpoints under the auth module for managing branch assignments. The create response includes the branch's localized name via a join. Regenerated swagger docs to include the new endpoints. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
46 lines
1.1 KiB
Go
Executable File
46 lines
1.1 KiB
Go
Executable File
package auth
|
|
|
|
import "time"
|
|
|
|
type LoginDTO struct {
|
|
Email string `json:"email" binding:"required"`
|
|
Password string `json:"password" binding:"required"`
|
|
}
|
|
|
|
type RefreshTokenDTO struct {
|
|
RefreshToken string `json:"refreshToken" binding:"required"`
|
|
}
|
|
|
|
type UserProfileDTO struct {
|
|
Id int `json:"id"`
|
|
FullName string `json:"fullName"`
|
|
PhoneNumber string `json:"phoneNumber"`
|
|
Avatar string `json:"avatar"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
}
|
|
|
|
type UserCredentials struct {
|
|
Id int
|
|
Password string
|
|
}
|
|
|
|
type LocalizedText struct {
|
|
En string `json:"en"`
|
|
Ru string `json:"ru"`
|
|
Tm string `json:"tm"`
|
|
}
|
|
|
|
type BranchUserDTO struct {
|
|
Id int64 `json:"id"`
|
|
BranchId int64 `json:"branchId"`
|
|
BranchName LocalizedText `json:"branchName"`
|
|
UserId int64 `json:"userId"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
type CreateBranchUserDTO struct {
|
|
BranchId int64 `json:"branchId" binding:"required"`
|
|
UserId int64 `json:"userId" binding:"required"`
|
|
}
|