39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
package dto
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
// UserStatus defines the possible status values for a user
|
|
type UserStatus string
|
|
|
|
const (
|
|
UserStatusApproved UserStatus = "approved"
|
|
UserStatusRejected UserStatus = "rejected"
|
|
UserStatusPending UserStatus = "pending"
|
|
)
|
|
|
|
type UserRegisterDTO struct {
|
|
Name string `json:"name" validate:"required"`
|
|
Username string `json:"username" validate:"required"`
|
|
Password string `json:"password" validate:"required,min=6"`
|
|
NomorInduk string `json:"nomor_induk" validate:"required"`
|
|
}
|
|
|
|
type UserLoginDTO struct {
|
|
Username string `json:"username" validate:"required"`
|
|
Password string `json:"password" validate:"required"`
|
|
|
|
}
|
|
type PendingUserResponse struct {
|
|
ID uuid.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Username string `json:"username"`
|
|
NomorInduk *string `json:"nomor_induk"`
|
|
RoleName string `json:"role_name"`
|
|
Status UserStatus `json:"status"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
} |