Documentation
¶
Overview ¶
Package userapp maintains the app layer api for the user domain.
Index ¶
- type App
- func (a *App) Create(ctx context.Context, app NewUser) (User, error)
- func (a *App) Delete(ctx context.Context) error
- func (a *App) Query(ctx context.Context, qp QueryParams) (query.Result[User], error)
- func (a *App) QueryByID(ctx context.Context) (User, error)
- func (a *App) Update(ctx context.Context, app UpdateUser) (User, error)
- func (a *App) UpdateRole(ctx context.Context, app UpdateUserRole) (User, error)
- type NewUser
- type QueryParams
- type UpdateApproveUser
- type UpdateUser
- type UpdateUserRole
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App manages the set of app layer api functions for the user domain.
func NewAppWithAuth ¶
NewAppWithAuth constructs a user app API for use with auth support.
func (*App) UpdateRole ¶
UpdateRole updates an existing user's role.
type NewUser ¶
type NewUser struct { RequestedBy string `json:"requestedBy" validate:"omitempty"` TitleID string `json:"titleID" validate:"omitempty"` OfficeID string `json:"officeID" validate:"omitempty"` WorkPhoneID string `json:"workPhoneID" validate:"omitempty"` CellPhoneID string `json:"cellPhoneID" validate:"omitempty"` Username string `json:"username" validate:"required"` FirstName string `json:"firstName" validate:"required"` LastName string `json:"lastName" validate:"required"` Email string `json:"email" validate:"required,email"` Birthday string `json:"birthday" validate:"required"` Roles []string `json:"roles" validate:"required"` SystemRoles []string `json:"systemRoles" validate:"required"` Password string `json:"password" validate:"required"` PasswordConfirm string `json:"passwordConfirm" validate:"eqfield=Password"` Enabled bool `json:"enabled"` }
NewUser defines the data needed to add a new user.
type QueryParams ¶
type QueryParams struct { Page string Rows string OrderBy string ID string RequestedBy string ApprovedBy string TitleID string OfficeID string Username string FirstName string LastName string Email string Enabled string StartBirthday string EndBirthday string StartDateHired string EndDateHired string StartDateRequested string EndDateRequested string StartDateApproved string EndDateApproved string StartCreatedDate string EndCreatedDate string }
QueryParams represents the set of possible query strings.
type UpdateApproveUser ¶
type UpdateApproveUser struct {
ApprovedBy string `json:"approvedBy" validate:"required"`
}
UpdateApproveUser defines the data needed to approve a user.
type UpdateUser ¶
type UpdateUser struct { TitleID *string `json:"titleID"` OfficeID *string `json:"officeID"` WorkPhoneID *string `json:"workPhoneID"` CellPhoneID *string `json:"cellPhoneID"` Username *string `json:"username"` FirstName *string `json:"firstName"` LastName *string `json:"lastName"` Email *string `json:"email" validate:"omitempty,email"` Birthday *string `json:"birthday"` Password *string `json:"password"` PasswordConfirm *string `json:"passwordConfirm" validate:"omitempty,eqfield=Password"` Enabled *bool `json:"enabled"` DateHired *string `json:"dateHired"` }
UpdateUser defines the data needed to update a user.
func (*UpdateUser) Decode ¶
func (app *UpdateUser) Decode(data []byte) error
Decode implements the decoder interface.
func (UpdateUser) Validate ¶
func (app UpdateUser) Validate() error
Validate checks the data in the model is considered clean.
type UpdateUserRole ¶
type UpdateUserRole struct {
Roles []string `json:"roles" validate:"required"`
}
UpdateUserRole defines the data needed to update a user role.
func (*UpdateUserRole) Decode ¶
func (app *UpdateUserRole) Decode(data []byte) error
Decode implements the decoder interface.
func (UpdateUserRole) Validate ¶
func (app UpdateUserRole) Validate() error
Validate checks the data in the model is considered clean.
type User ¶
type User struct { ID string `json:"id"` RequestedBy string `json:"requestedBy"` ApprovedBy string `json:"approvedBy"` TitleID string `json:"titleID"` OfficeID string `json:"officeID"` WorkPhoneID string `json:"workPhoneID"` CellPhoneID string `json:"cellPhoneID"` Username string `json:"username"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Email string `json:"email"` Birthday string `json:"birthday"` Roles []string `json:"roles"` SystemRoles []string `json:"systemRoles"` PasswordHash []byte `json:"-"` Enabled bool `json:"enabled"` DateHired string `json:"dateHired"` DateRequested string `json:"dateRequested"` DateApproved string `json:"dateApproved"` DateCreated string `json:"dateCreated"` DateUpdated string `json:"dateUpdated"` }
User represents information about an individual user.