employee

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateDTO

type CreateDTO struct {
	FirstName   string
	LastName    string
	MiddleName  string
	Email       string
	Phone       string
	Salary      float64
	Coefficient float64
}

func (*CreateDTO) Ok

func (d *CreateDTO) Ok(l ut.Translator) (map[string]string, bool)

func (*CreateDTO) ToEntity

func (d *CreateDTO) ToEntity() *Employee

type CreatedEvent

type CreatedEvent struct {
	Sender  user.User
	Session session.Session
	Data    CreateDTO
	Result  Employee
}

func NewCreatedEvent

func NewCreatedEvent(ctx context.Context, data CreateDTO, result Employee) (*CreatedEvent, error)

type DeletedEvent

type DeletedEvent struct {
	Sender  user.User
	Session session.Session
	Result  Employee
}

func NewDeletedEvent

func NewDeletedEvent(ctx context.Context, result Employee) (*DeletedEvent, error)

type Employee

type Employee struct {
	ID          uint
	FirstName   string
	LastName    string
	MiddleName  string
	Email       string
	Phone       string
	Salary      float64
	HourlyRate  float64
	Coefficient float64
	Meta        *Meta
	Position    *position.Position
	AvatarID    uint
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type Meta

type Meta struct {
	EmployeeID        uint
	PrimaryLanguage   *string
	SecondaryLanguage *string
	Tin               *string
	BirthDate         *time.Time
	JoinDate          *time.Time
	LeaveDate         *time.Time
	GeneralInfo       *string
	YtProfileID       string
	UpdatedAt         *time.Time
}

type Repository

type Repository interface {
	Count(ctx context.Context) (int64, error)
	GetAll(ctx context.Context) ([]*Employee, error)
	GetPaginated(ctx context.Context, limit, offset int, sortBy []string) ([]*Employee, error)
	GetByID(ctx context.Context, id uint) (*Employee, error)
	Create(ctx context.Context, data *Employee) error
	Update(ctx context.Context, data *Employee) error
	Delete(ctx context.Context, id uint) error
}

type UpdateDTO

type UpdateDTO struct {
	FirstName   string
	LastName    string
	MiddleName  string
	Email       string
	Phone       string
	Salary      float64
	Coefficient float64
}

func (*UpdateDTO) Ok

func (d *UpdateDTO) Ok(l ut.Translator) (map[string]string, bool)

func (*UpdateDTO) ToEntity

func (d *UpdateDTO) ToEntity(id uint) *Employee

type UpdatedEvent

type UpdatedEvent struct {
	Sender  user.User
	Session session.Session
	Data    UpdateDTO
	Result  Employee
}

func NewUpdatedEvent

func NewUpdatedEvent(ctx context.Context, data UpdateDTO, result Employee) (*UpdatedEvent, error)

Jump to

Keyboard shortcuts

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