Documentation ¶
Index ¶
- type App
- func (a *App) Create(ctx context.Context, app NewAsset) (Asset, error)
- func (a *App) Delete(ctx context.Context, id uuid.UUID) error
- func (a *App) Query(ctx context.Context, qp QueryParams) (query.Result[Asset], error)
- func (a *App) QueryByID(ctx context.Context, id uuid.UUID) (Asset, error)
- func (a *App) Update(ctx context.Context, app UpdateAsset, id uuid.UUID) (Asset, error)
- type Asset
- type NewAsset
- type QueryParams
- type UpdateAsset
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 asset domain.
func NewAppWithAuth ¶
NewAppWithAuth constructs a asset app API for use with auth support.
type Asset ¶
type Asset struct { ID string `json:"id"` TypeID string `json:"type_id"` ConditionID string `json:"condition_id"` Name string `json:"name"` EstPrice string `json:"est_price"` Price string `json:"price"` MaintenanceInterval string `json:"maintenance_interval"` LifeExpectancy string `json:"life_expectancy"` ModelNumber string `json:"model_number"` IsEnabled bool `json:"is_enabled"` DateCreated string `json:"date_created"` DateUpdated string `json:"date_updated"` CreatedBy string `json:"created_by"` UpdatedBy string `json:"updated_by"` }
func ToAppAsset ¶
func ToAppAssets ¶
type NewAsset ¶
type NewAsset struct { TypeID string `json:"type_id" validate:"required"` ConditionID string `json:"condition_id" validate:"required"` Name string `json:"name" validate:"required"` EstPrice string `json:"est_price"` Price string `json:"price"` MaintenanceInterval string `json:"maintenance_interval"` LifeExpectancy string `json:"life_expectancy"` ModelNumber string `json:"model_number"` IsEnabled bool `json:"is_enabled"` CreatedBy string `json:"created_by"` }
type QueryParams ¶
type QueryParams struct { Page string Rows string OrderBy string ID string TypeID string ConditionID string Name string EstPrice string Price string MaintenanceInterval string LifeExpectancy string ModelNumber string IsEnabled string StartDateCreated string EndDateCreated string StartDateUpdated string EndDateUpdated string CreatedBy string UpdatedBy string }
type UpdateAsset ¶
type UpdateAsset struct { TypeID *string `json:"type_id"` ConditionID *string `json:"condition_id"` Name *string `json:"name"` EstPrice *string `json:"est_price"` Price *string `json:"price"` MaintenanceInterval *string `json:"maintenance_interval"` LifeExpectancy *string `json:"life_expectancy"` ModelNumber *string `json:"model_number"` IsEnabled *bool `json:"is_enabled"` UpdatedBy *string `json:"updated_by"` }
UpdateAsset contains information needed to update an asset.
func (*UpdateAsset) Decode ¶
func (app *UpdateAsset) Decode(data []byte) error
Decode implements the decoder interface.
func (UpdateAsset) Validate ¶
func (app UpdateAsset) Validate() error
Validate checks the data in the model is considered clean.
Click to show internal directories.
Click to hide internal directories.