employee

package
v0.0.0-...-2fddd97 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmployeeCreateInput

type EmployeeCreateInput struct {
	CompanyID   int    `json:"-"`
	FullName    string `max:"32" json:"full_name"`
	Email       string `max:"48" json:"email"`
	PhoneNumber string `max:"16" json:"phone_number"`
	RoleID      int    `json:"role_id"`
}

EmployeeCreateInput is used as request for create new employee

type EmployeeListInput

type EmployeeListInput struct {
	CompanyID int `json:"-"`
	Page      int `min:"1" json:"-"`
	Limit     int `min:"10" json:"-"`
}

EmployeeListInput is used as request for employee list

type EmployeeListOutput

type EmployeeListOutput struct {
	Count     int              `json:"count"`
	Employees []EmployeeOutput `json:"employees"`
}

EmployeeListOutput is used as response for employee list

type EmployeeOutput

type EmployeeOutput struct {
	ID          int    `json:"id"`
	FullName    string `json:"full_name"`
	Email       string `json:"email"`
	PhoneNumber string `json:"phone_number"`
	RoleID      int    `json:"role_id"`
	RoleName    string `json:"role_name"`
	Status      string `json:"status"`
	RowUpdated  int    `json:"row_updated"`
}

EmployeeOutput is used as response for employee

type EmployeeUpdateInput

type EmployeeUpdateInput struct {
	CompanyID int    `json:"-"`
	ID        int    `json:"id"`
	FullName  string `max:"32" json:"full_name"`
	RoleID    int    `json:"role_id"`
}

EmployeeUpdateInput is used as request for update existing employee

type ServiceEmployee

type ServiceEmployee struct {
	// contains filtered or unexported fields
}

ServiceEmployee contains repositories and Employee use cases

func New

New returns the ServiceEmployee service

func (*ServiceEmployee) CreateEmployee

func (s *ServiceEmployee) CreateEmployee(eci EmployeeCreateInput) (*EmployeeOutput, int, error)

CreateEmployee is used to create employee data

func (*ServiceEmployee) GetEmployeeList

func (s *ServiceEmployee) GetEmployeeList(eli EmployeeListInput) (*EmployeeListOutput, int, error)

GetEmployeeList is used to get employee list

func (*ServiceEmployee) UpdateEmployee

func (s *ServiceEmployee) UpdateEmployee(eui EmployeeUpdateInput) (*EmployeeOutput, int, error)

UpdateEmployee is used to update employee data

Jump to

Keyboard shortcuts

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