project_stages

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: GPL-3.0 Imports: 5 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 {
	ProjectID uint      `schema:"project_id,required"`
	Name      string    `schema:"name,required"`
	Margin    float64   `schema:"margin,required"`
	Risks     float64   `schema:"risks,required"`
	StartDate time.Time `schema:"start_date,required"`
	EndDate   time.Time `schema:"end_date,required"`
}

func (*CreateDTO) ToEntity

func (p *CreateDTO) ToEntity() *ProjectStage

type CreatedEvent

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

func NewCreatedEvent

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

type DeletedEvent

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

func NewDeletedEvent

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

type ProjectStage

type ProjectStage struct {
	ID        uint
	ProjectID uint
	Name      string
	Margin    float64
	Risks     float64
	StartDate time.Time
	EndDate   time.Time
	CreatedAt time.Time
	UpdatedAt time.Time
}

type Repository

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

type UpdateDTO

type UpdateDTO struct {
	ProjectID uint      `schema:"project_id"`
	Name      string    `schema:"name"`
	Margin    float64   `schema:"margin"`
	Risks     float64   `schema:"risks"`
	StartDate time.Time `schema:"start_date"`
	EndDate   time.Time `schema:"end_date"`
}

func (*UpdateDTO) ToEntity

func (p *UpdateDTO) ToEntity(id uint) *ProjectStage

type UpdatedEvent

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

func NewUpdatedEvent

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

Jump to

Keyboard shortcuts

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