project

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: 8 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 {
	Name        string `validate:"required"`
	Description string
}

func (*CreateDTO) Ok

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

func (*CreateDTO) ToEntity

func (d *CreateDTO) ToEntity() *Project

type CreatedEvent

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

func NewCreatedEvent

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

type DeletedEvent

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

func NewDeletedEvent

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

type Project

type Project struct {
	ID   uint
	Name string
	// Counterparty
	Description string
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type Repository

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

type UpdateDTO

type UpdateDTO struct {
	Name        string
	Description string
}

func (*UpdateDTO) Ok

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

func (*UpdateDTO) ToEntity

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

type UpdatedEvent

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

func NewUpdatedEvent

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

Jump to

Keyboard shortcuts

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