reportstoapp

package
v0.0.0-...-16ef530 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToBusNewReportsTo

func ToBusNewReportsTo(app NewReportsTo) reportstobus.NewReportsTo

Types

type App

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

App manages the set of app layer api functions for the reports to domain.

func NewApp

func NewApp(reportsToBus *reportstobus.Business) *App

NewApp constructs a reports to app API for use.

func NewAppWithAuth

func NewAppWithAuth(reportsToBus *reportstobus.Business, ath *auth.Auth) *App

NewAppWithAuth constructs a reports to app API for use with auth support.

func (*App) Create

func (a *App) Create(ctx context.Context, app NewReportsTo) (ReportsTo, error)

Create adds a new reports to entry to the system.

func (*App) Delete

func (a *App) Delete(ctx context.Context, id uuid.UUID) error

Delete removes an existing reports to.

func (*App) Query

func (a *App) Query(ctx context.Context, qp QueryParams) (query.Result[ReportsTo], error)

Query returns a list of reports tos.

func (*App) QueryByID

func (a *App) QueryByID(ctx context.Context, id uuid.UUID) (ReportsTo, error)

QueryByID returns a single reports to based on the id.

func (*App) Update

func (a *App) Update(ctx context.Context, app UpdateReportsTo, id uuid.UUID) (ReportsTo, error)

Update updates an existing reports to.

type NewReportsTo

type NewReportsTo struct {
	BossID     string `json:"boss_id" validate:"required,min=36,max=36"`
	ReporterID string `json:"reporter_id" validate:"required,min=36,max=36"`
}

func (*NewReportsTo) Decode

func (app *NewReportsTo) Decode(data []byte) error

Decode implements the decoder interface.

func (NewReportsTo) Validate

func (app NewReportsTo) Validate() error

Validate checks the data in the model is considered clean.

type QueryParams

type QueryParams struct {
	Page       string
	Rows       string
	OrderBy    string
	ID         string
	BossID     string
	ReporterID string
}

QueryParams represents the query parameters that can be used.

type ReportsTo

type ReportsTo struct {
	ID         string `json:"id"`
	BossID     string `json:"boss_id"`
	ReporterID string `json:"reporter_id"`
}

func ToAppReportsTo

func ToAppReportsTo(bus reportstobus.ReportsTo) ReportsTo

func ToAppReportsTos

func ToAppReportsTos(bus []reportstobus.ReportsTo) []ReportsTo

func (ReportsTo) Encode

func (app ReportsTo) Encode() ([]byte, string, error)

Encode implements the encoder interface.

type UpdateReportsTo

type UpdateReportsTo struct {
	BossID     *string `json:"boss_id" validate:"omitempty,min=36,max=36"`
	ReporterID *string `json:"reporter_id" validate:"omitempty,min=36,max=36"`
}

func (*UpdateReportsTo) Decode

func (app *UpdateReportsTo) Decode(data []byte) error

Decode implements the decoder interface.

func (UpdateReportsTo) Validate

func (app UpdateReportsTo) Validate() error

Validate checks the data in the model is considered clean.

Jump to

Keyboard shortcuts

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