dto

package
v0.0.0-...-da52609 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionType

type ActionType string
const (
	Create ActionType = "create"
	Login  ActionType = "login"
)

type AuthRequest

type AuthRequest struct {
	Name     string
	Email    string
	Password string
	Action   string
}

func (*AuthRequest) ComparePassword

func (d *AuthRequest) ComparePassword(password string) error

func (*AuthRequest) HashPassword

func (d *AuthRequest) HashPassword() error

func (*AuthRequest) SetName

func (d *AuthRequest) SetName()

func (*AuthRequest) ValidatePayloadAuth

func (d *AuthRequest) ValidatePayloadAuth() error

type AuthResponse

type AuthResponse struct {
	Email string `json:"email"`
	Token string `json:"token"`
}

type Department

type Department struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type DepartmentRequest

type DepartmentRequest struct {
	Name      string `validate:"required,min=4,max=33"`
	ManagerID int    `json:"-"`
}

type DepartmentResponse

type DepartmentResponse struct {
	DepartmentID string `json:"departmentId"`
	Name         string `json:"name"`
}

type Employee

type Employee struct {
	ID               int
	IdentityNumber   string     `json:"identityNumber"`
	Name             string     `json:"name"`
	Gender           GenderType `json:"gender"`
	DepartmentID     string     `json:"departmentId"`
	EmployeeImageURI string     `json:"employeeImageUri"`
}

type EmployeeRequest

type EmployeeRequest struct {
	IdentityNumber   string     `validate:"required,min=5,max=33"`
	Name             string     `validate:"required,min=4,max=33"`
	Gender           GenderType `validate:"oneof=male female"`
	DepartmentID     string     `validate:"required"`
	EmployeeImageURI string     `validate:"url"`
	Limit            int
	Offset           int
}

type EmployeeResponse

type EmployeeResponse struct {
	IdentityNumber   string `json:"identityNumber"`
	Name             string `json:"name"`
	Gender           string `json:"gender"`
	DepartmentID     string `json:"departmentId"`
	EmployeeImageURI string `json:"employeeImageUri"`
}

type GenderType

type GenderType string

type GetAllDepartmentRequest

type GetAllDepartmentRequest struct {
	Name      string `form:"name"`
	ManagerID int    `form:"-"`

	PaginationRequest
}

type GetAllEmployeeRequest

type GetAllEmployeeRequest struct {
	IdentityNumber string `form:"identityNumber"`
	Name           string `form:"name"`
	Gender         string `form:"gender"`
	DepartmentID   string `form:"departmentId"`
	ManagerID      int    `form:"-"`

	PaginationRequest
}

type PaginationRequest

type PaginationRequest struct {
	Limit  string `form:"limit"`
	Offset string `form:"offset"`
}

func (*PaginationRequest) GetLimit

func (p *PaginationRequest) GetLimit() int64

func (*PaginationRequest) GetOffset

func (p *PaginationRequest) GetOffset() int64

type UpdateEmployeeRequest

type UpdateEmployeeRequest struct {
	IdentityNumber   string     `json:"identityNumber" validate:"min=5,max=33"`
	Name             string     `json:"name" validate:"min=5,max=33"`
	EmployeeImageURI string     `json:"employeeImageUri" validate:"url"`
	Gender           GenderType `json:"gender" validate:"oneof=male female"`
	DepartmentID     string     `json:"departmentId" validate:"required"`
	ManagerID        int        `form:"-"`
}

type UpdateEmployeeResponse

type UpdateEmployeeResponse struct {
	IdentityNumber   string `json:"identityNumber"`
	Name             string `json:"name"`
	EmployeeImageURI string `json:"employeeImageUri"`
	Gender           string `json:"gender"`
	DepartmentID     string `json:"departmentId"`
}

type User

type User struct {
	Email           string `json:"email"`
	Name            string `json:"name"`
	UserImageUri    string `json:"userImageUri"`
	CompanyName     string `json:"companyName"`
	CompanyImageUri string `json:"companyImageUri"`
}

type UserPatchRequest

type UserPatchRequest struct {
	Email           *string `json:"email" validate:"email"`
	Name            *string `json:"name" validate:"min=4,max=52"`
	UserImageUri    *string `json:"userImageUri" validate:"url"`
	CompanyName     *string `json:"companyName" validate:"min=4,max=52"`
	CompanyImageUri *string `json:"companyImageUri" validate:"url"`
}

func (*UserPatchRequest) Validate

func (u *UserPatchRequest) Validate() error

type UserRequest

type UserRequest struct {
	UserID int `json:"id"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL