approvalstatusapp

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

This section is empty.

Types

type App

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

App manages the set of app layer api functions for the approval status domain.

func NewApp

func NewApp(approvalstatusBus *approvalstatusbus.Business) *App

NewApp constructs an approval status app API for use.

func NewAppWithAuth

func NewAppWithAuth(approvalstatusBus *approvalstatusbus.Business, ath *auth.Auth) *App

NewAppWithAuth constructs an approval status app API for use with auth support.

func (*App) Create

func (a *App) Create(ctx context.Context, app NewApprovalStatus) (ApprovalStatus, error)

Create adds a new approval status to the system

func (*App) Delete

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

Delete removes an existing approval status

func (*App) Query

Query returns a list of approval statuses based on the filter, order and page

func (*App) QueryByID

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

QueryByID retrieves the approval status by ID

func (*App) Update

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

Update updates an existing approval status

type ApprovalStatus

type ApprovalStatus struct {
	ID     string `json:"id"`
	IconID string `json:"icon_id"`
	Name   string `json:"name"`
}

func ToAppApprovalStatuses

func ToAppApprovalStatuses(bus []approvalstatusbus.ApprovalStatus) []ApprovalStatus

func (ApprovalStatus) Encode

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

type NewApprovalStatus

type NewApprovalStatus struct {
	IconID string `json:"iconID" validate:"required"`
	Name   string `json:"name" validate:"required,min=3,max=100"`
}

func (*NewApprovalStatus) Decode

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

func (NewApprovalStatus) Validate

func (app NewApprovalStatus) Validate() error

type QueryParams

type QueryParams struct {
	Page    string
	Rows    string
	OrderBy string
	ID      string
	IconID  string
	Name    string
}

type UpdateApprovalStatus

type UpdateApprovalStatus struct {
	IconID *string `json:"icon_id" validate:"required"`
	Name   *string `json:"name" validate:"required,min=3,max=100"`
}

func (*UpdateApprovalStatus) Decode

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

func (UpdateApprovalStatus) Validate

func (app UpdateApprovalStatus) Validate() error

Jump to

Keyboard shortcuts

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