v1

package
v0.0.0-...-1638e35 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: AGPL-3.0 Imports: 32 Imported by: 0

Documentation

Overview

Package v1 provides the API handlers for version 1 of the API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDemoStatus

func WithDemoStatus(demoStatus bool) func(*V1Controller)

func WithMaxUploadSize

func WithMaxUploadSize(maxUploadSize int64) func(*V1Controller)

func WithRegistration

func WithRegistration(allowRegistration bool) func(*V1Controller)

func WithSecureCookies

func WithSecureCookies(secure bool) func(*V1Controller)

func WithURL

func WithURL(url string) func(*V1Controller)

Types

type APISummary

type APISummary struct {
	Healthy           bool     `json:"health"`
	Versions          []string `json:"versions"`
	Title             string   `json:"title"`
	Message           string   `json:"message"`
	Build             Build    `json:"build"`
	Demo              bool     `json:"demo"`
	AllowRegistration bool     `json:"allowRegistration"`
}

type ActionAmountResult

type ActionAmountResult struct {
	Completed int `json:"completed"`
}

type AuthProvider

type AuthProvider interface {
	// Name returns the name of the authentication provider. This should be a unique name.
	// that is URL friendly.
	//
	// Example: "local", "ldap"
	Name() string
	// Authenticate is called when a user attempts to login to the API. The implementation
	// should return an error if the user cannot be authenticated. If an error is returned
	// the API controller will return a vague error message to the user.
	//
	// Authenticate should do the following:
	//
	// 1. Ensure that the user exists within the database (either create, or get)
	// 2. On successful authentication, they must set the user cookies.
	Authenticate(w http.ResponseWriter, r *http.Request) (services.UserAuthTokenDetail, error)
}

AuthProvider is an interface that can be implemented by any authentication provider. to extend authentication methods for the API.

type Build

type Build struct {
	Version   string `json:"version"`
	Commit    string `json:"commit"`
	BuildTime string `json:"buildTime"`
}

type ChangePassword

type ChangePassword struct {
	Current string `json:"current,omitempty"`
	New     string `json:"new,omitempty"`
}

type CookieContents

type CookieContents struct {
	Token     string
	ExpiresAt time.Time
	Remember  bool
}

func GetCookies

func GetCookies(r *http.Request) (*CookieContents, error)

type GroupInvitation

type GroupInvitation struct {
	Token     string    `json:"token"`
	ExpiresAt time.Time `json:"expiresAt"`
	Uses      int       `json:"uses"`
}

type GroupInvitationCreate

type GroupInvitationCreate struct {
	Uses      int       `json:"uses"      validate:"required,min=1,max=100"`
	ExpiresAt time.Time `json:"expiresAt"`
}

type ItemAttachmentToken

type ItemAttachmentToken struct {
	Token string `json:"token"`
}

type LoginForm

type LoginForm struct {
	Username     string `json:"username" example:"admin@admin.com"`
	Password     string `json:"password" example:"admin"`
	StayLoggedIn bool   `json:"stayLoggedIn"`
}

type ReadyFunc

type ReadyFunc func() bool

type Results

type Results[T any] struct {
	Items []T `json:"items"`
}

func WrapResults

func WrapResults[T any](items []T) Results[T]

type TokenResponse

type TokenResponse struct {
	Token           string    `json:"token"`
	ExpiresAt       time.Time `json:"expiresAt"`
	AttachmentToken string    `json:"attachmentToken"`
}

type V1Controller

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

func NewControllerV1

func NewControllerV1(svc *services.AllServices, repos *repo.AllRepos, bus *eventbus.EventBus, options ...func(*V1Controller)) *V1Controller

func (*V1Controller) GetLocationWithPrice

func (ctrl *V1Controller) GetLocationWithPrice(auth context.Context, gid uuid.UUID, id uuid.UUID) (repo.LocationOut, error)

func (*V1Controller) HandleAssetGet

func (ctrl *V1Controller) HandleAssetGet() errchain.HandlerFunc

HandleAssetGet godocs

@Summary	Get Item by Asset ID
@Tags		Items
@Produce	json
@Param		id	path		string	true	"Asset ID"
@Success	200	{object}	repo.PaginationResult[repo.ItemSummary]{}
@Router		/v1/assets/{id} [GET]
@Security	Bearer

func (*V1Controller) HandleAuthLogin

func (ctrl *V1Controller) HandleAuthLogin(ps ...AuthProvider) errchain.HandlerFunc

HandleAuthLogin godoc

@Summary User Login
@Tags    Authentication
@Accept  x-www-form-urlencoded
@Accept  application/json
@Param   payload body     LoginForm true "Login Data"
@Param   provider    query    string   false "auth provider"
@Produce json
@Success 200 {object} TokenResponse
@Router  /v1/users/login [POST]

func (*V1Controller) HandleAuthLogout

func (ctrl *V1Controller) HandleAuthLogout() errchain.HandlerFunc

HandleAuthLogout godoc

@Summary	User Logout
@Tags		Authentication
@Success	204
@Router		/v1/users/logout [POST]
@Security	Bearer

func (*V1Controller) HandleAuthRefresh

func (ctrl *V1Controller) HandleAuthRefresh() errchain.HandlerFunc

HandleAuthRefresh godoc

@Summary		User Token Refresh
@Description	handleAuthRefresh returns a handler that will issue a new token from an existing token.
@Description	This does not validate that the user still exists within the database.
@Tags			Authentication
@Success		200
@Router			/v1/users/refresh [GET]
@Security		Bearer

func (*V1Controller) HandleBase

func (ctrl *V1Controller) HandleBase(ready ReadyFunc, build Build) errchain.HandlerFunc

HandleBase godoc

@Summary	Application Info
@Tags		Base
@Produce	json
@Success	200	{object}	APISummary
@Router		/v1/status [GET]

func (*V1Controller) HandleBillOfMaterialsExport

func (ctrl *V1Controller) HandleBillOfMaterialsExport() errchain.HandlerFunc

HandleBillOfMaterialsExport godoc

@Summary	Export Bill of Materials
@Tags		Reporting
@Produce	json
@Success	200	{string}	string	"text/csv"
@Router		/v1/reporting/bill-of-materials [GET]
@Security	Bearer

func (*V1Controller) HandleCacheWS

func (ctrl *V1Controller) HandleCacheWS() errchain.HandlerFunc

func (*V1Controller) HandleCreateNotifier

func (ctrl *V1Controller) HandleCreateNotifier() errchain.HandlerFunc

HandleCreateNotifier godoc

@Summary	Create Notifier
@Tags		Notifiers
@Produce	json
@Param		payload	body		repo.NotifierCreate	true	"Notifier Data"
@Success	200		{object}	repo.NotifierOut
@Router		/v1/notifiers [POST]
@Security	Bearer

func (*V1Controller) HandleCurrency

func (ctrl *V1Controller) HandleCurrency() errchain.HandlerFunc

HandleCurrency godoc

@Summary	Currency
@Tags		Base
@Produce	json
@Success	200	{object}	currencies.Currency
@Router		/v1/currency [GET]

func (*V1Controller) HandleDeleteNotifier

func (ctrl *V1Controller) HandleDeleteNotifier() errchain.HandlerFunc

HandleDeleteNotifier godocs

@Summary	Delete a Notifier
@Tags		Notifiers
@Param		id	path	string	true	"Notifier ID"
@Success	204
@Router		/v1/notifiers/{id} [DELETE]
@Security	Bearer

func (*V1Controller) HandleEnsureAssetID

func (ctrl *V1Controller) HandleEnsureAssetID() errchain.HandlerFunc

HandleEnsureAssetID godoc

@Summary		Ensure Asset IDs
@Description	Ensures all items in the database have an asset ID
@Tags			Actions
@Produce		json
@Success		200	{object}	ActionAmountResult
@Router			/v1/actions/ensure-asset-ids [Post]
@Security		Bearer

func (*V1Controller) HandleEnsureImportRefs

func (ctrl *V1Controller) HandleEnsureImportRefs() errchain.HandlerFunc

HandleEnsureImportRefs godoc

@Summary		Ensures Import Refs
@Description	Ensures all items in the database have an import ref
@Tags			Actions
@Produce		json
@Success		200	{object}	ActionAmountResult
@Router			/v1/actions/ensure-import-refs [Post]
@Security		Bearer

func (*V1Controller) HandleGenerateQRCode

func (ctrl *V1Controller) HandleGenerateQRCode() errchain.HandlerFunc

HandleGenerateQRCode godoc

@Summary	Create QR Code
@Tags		Items
@Produce	json
@Param		data	query		string	false	"data to be encoded into qrcode"
@Success	200		{string}	string	"image/jpeg"
@Router		/v1/qrcode [GET]
@Security	Bearer

func (*V1Controller) HandleGetAllCustomFieldNames

func (ctrl *V1Controller) HandleGetAllCustomFieldNames() errchain.HandlerFunc

HandleGetAllCustomFieldNames godocs

@Summary	Get All Custom Field Names
@Tags		Items
@Produce	json
@Success	200
@Router		/v1/items/fields [GET]
@Success	200	{object}	[]string
@Security	Bearer

func (*V1Controller) HandleGetAllCustomFieldValues

func (ctrl *V1Controller) HandleGetAllCustomFieldValues() errchain.HandlerFunc

HandleGetAllCustomFieldValues godocs

@Summary	Get All Custom Field Values
@Tags		Items
@Produce	json
@Success	200
@Router		/v1/items/fields/values [GET]
@Success	200	{object}	[]string
@Security	Bearer

func (*V1Controller) HandleGetUserNotifiers

func (ctrl *V1Controller) HandleGetUserNotifiers() errchain.HandlerFunc

HandleGetUserNotifiers godoc

@Summary	Get Notifiers
@Tags		Notifiers
@Produce	json
@Success	200	{object}	[]repo.NotifierOut
@Router		/v1/notifiers [GET]
@Security	Bearer

func (*V1Controller) HandleGroupGet

func (ctrl *V1Controller) HandleGroupGet() errchain.HandlerFunc

HandleGroupGet godoc

@Summary	Get Group
@Tags		Group
@Produce	json
@Success	200	{object}	repo.Group
@Router		/v1/groups [Get]
@Security	Bearer

func (*V1Controller) HandleGroupInvitationsCreate

func (ctrl *V1Controller) HandleGroupInvitationsCreate() errchain.HandlerFunc

HandleGroupInvitationsCreate godoc

@Summary	Create Group Invitation
@Tags		Group
@Produce	json
@Param		payload	body		GroupInvitationCreate	true	"User Data"
@Success	200		{object}	GroupInvitation
@Router		/v1/groups/invitations [Post]
@Security	Bearer

func (*V1Controller) HandleGroupStatistics

func (ctrl *V1Controller) HandleGroupStatistics() errchain.HandlerFunc

HandleGroupStatistics godoc

@Summary	Get Group Statistics
@Tags		Statistics
@Produce	json
@Success	200	{object}	repo.GroupStatistics
@Router		/v1/groups/statistics [GET]
@Security	Bearer

func (*V1Controller) HandleGroupStatisticsLabels

func (ctrl *V1Controller) HandleGroupStatisticsLabels() errchain.HandlerFunc

HandleGroupStatisticsLabels godoc

@Summary	Get Label Statistics
@Tags		Statistics
@Produce	json
@Success	200	{object}	[]repo.TotalsByOrganizer
@Router		/v1/groups/statistics/labels [GET]
@Security	Bearer

func (*V1Controller) HandleGroupStatisticsLocations

func (ctrl *V1Controller) HandleGroupStatisticsLocations() errchain.HandlerFunc

HandleGroupStatisticsLocations godoc

@Summary	Get Location Statistics
@Tags		Statistics
@Produce	json
@Success	200	{object}	[]repo.TotalsByOrganizer
@Router		/v1/groups/statistics/locations [GET]
@Security	Bearer

func (*V1Controller) HandleGroupStatisticsPriceOverTime

func (ctrl *V1Controller) HandleGroupStatisticsPriceOverTime() errchain.HandlerFunc

HandleGroupStatisticsPriceOverTime godoc

@Summary	Get Purchase Price Statistics
@Tags		Statistics
@Produce	json
@Success	200		{object}	repo.ValueOverTime
@Param		start	query		string	false	"start date"
@Param		end		query		string	false	"end date"
@Router		/v1/groups/statistics/purchase-price [GET]
@Security	Bearer

func (*V1Controller) HandleGroupUpdate

func (ctrl *V1Controller) HandleGroupUpdate() errchain.HandlerFunc

HandleGroupUpdate godoc

@Summary	Update Group
@Tags		Group
@Produce	json
@Param		payload	body		repo.GroupUpdate	true	"User Data"
@Success	200		{object}	repo.Group
@Router		/v1/groups [Put]
@Security	Bearer

func (*V1Controller) HandleItemAttachmentCreate

func (ctrl *V1Controller) HandleItemAttachmentCreate() errchain.HandlerFunc

HandleItemAttachmentCreate godocs

@Summary  Create Item Attachment
@Tags     Items Attachments
@Accept   multipart/form-data
@Produce  json
@Param    id   path     string true "Item ID"
@Param    file formData file   true "File attachment"
@Param    type formData string true "Type of file"
@Param    name formData string true "name of the file including extension"
@Success  200  {object} repo.ItemOut
@Failure  422  {object} validate.ErrorResponse
@Router   /v1/items/{id}/attachments [POST]
@Security Bearer

func (*V1Controller) HandleItemAttachmentDelete

func (ctrl *V1Controller) HandleItemAttachmentDelete() errchain.HandlerFunc

HandleItemAttachmentDelete godocs

@Summary	Delete Item Attachment
@Tags		Items Attachments
@Param		id				path	string	true	"Item ID"
@Param		attachment_id	path	string	true	"Attachment ID"
@Success	204
@Router		/v1/items/{id}/attachments/{attachment_id} [DELETE]
@Security	Bearer

func (*V1Controller) HandleItemAttachmentGet

func (ctrl *V1Controller) HandleItemAttachmentGet() errchain.HandlerFunc

HandleItemAttachmentGet godocs

@Summary	Get Item Attachment
@Tags		Items Attachments
@Produce	application/octet-stream
@Param		id				path		string	true	"Item ID"
@Param		attachment_id	path		string	true	"Attachment ID"
@Success	200				{object}	ItemAttachmentToken
@Router		/v1/items/{id}/attachments/{attachment_id} [GET]
@Security	Bearer

func (*V1Controller) HandleItemAttachmentUpdate

func (ctrl *V1Controller) HandleItemAttachmentUpdate() errchain.HandlerFunc

HandleItemAttachmentUpdate godocs

@Summary	Update Item Attachment
@Tags		Items Attachments
@Param		id				path		string						true	"Item ID"
@Param		attachment_id	path		string						true	"Attachment ID"
@Param		payload			body		repo.ItemAttachmentUpdate	true	"Attachment Update"
@Success	200				{object}	repo.ItemOut
@Router		/v1/items/{id}/attachments/{attachment_id} [PUT]
@Security	Bearer

func (*V1Controller) HandleItemDateZeroOut

func (ctrl *V1Controller) HandleItemDateZeroOut() errchain.HandlerFunc

HandleItemDateZeroOut godoc

@Summary		Zero Out Time Fields
@Description	Resets all item date fields to the beginning of the day
@Tags			Actions
@Produce		json
@Success		200	{object}	ActionAmountResult
@Router			/v1/actions/zero-item-time-fields [Post]
@Security		Bearer

func (*V1Controller) HandleItemDelete

func (ctrl *V1Controller) HandleItemDelete() errchain.HandlerFunc

HandleItemDelete godocs

@Summary	Delete Item
@Tags		Items
@Produce	json
@Param		id	path	string	true	"Item ID"
@Success	204
@Router		/v1/items/{id} [DELETE]
@Security	Bearer

func (*V1Controller) HandleItemFullPath

func (ctrl *V1Controller) HandleItemFullPath() errchain.HandlerFunc

HandleItemFullPath godoc

@Summary	Get the full path of an item
@Tags		Items
@Produce	json
@Param		id	path		string	true	"Item ID"
@Success	200	{object}	[]repo.ItemPath
@Router		/v1/items/{id}/path [GET]
@Security	Bearer

func (*V1Controller) HandleItemGet

func (ctrl *V1Controller) HandleItemGet() errchain.HandlerFunc

HandleItemGet godocs

@Summary	Get Item
@Tags		Items
@Produce	json
@Param		id	path		string	true	"Item ID"
@Success	200	{object}	repo.ItemOut
@Router		/v1/items/{id} [GET]
@Security	Bearer

func (*V1Controller) HandleItemPatch

func (ctrl *V1Controller) HandleItemPatch() errchain.HandlerFunc

HandleItemPatch godocs

@Summary	Update Item
@Tags		Items
@Produce	json
@Param		id		path		string			true	"Item ID"
@Param		payload	body		repo.ItemPatch	true	"Item Data"
@Success	200		{object}	repo.ItemOut
@Router		/v1/items/{id} [Patch]
@Security	Bearer

func (*V1Controller) HandleItemUpdate

func (ctrl *V1Controller) HandleItemUpdate() errchain.HandlerFunc

HandleItemUpdate godocs

@Summary	Update Item
@Tags		Items
@Produce	json
@Param		id		path		string			true	"Item ID"
@Param		payload	body		repo.ItemUpdate	true	"Item Data"
@Success	200		{object}	repo.ItemOut
@Router		/v1/items/{id} [PUT]
@Security	Bearer

func (*V1Controller) HandleItemsCreate

func (ctrl *V1Controller) HandleItemsCreate() errchain.HandlerFunc

HandleItemsCreate godoc

@Summary	Create Item
@Tags		Items
@Produce	json
@Param		payload	body		repo.ItemCreate	true	"Item Data"
@Success	201		{object}	repo.ItemSummary
@Router		/v1/items [POST]
@Security	Bearer

func (*V1Controller) HandleItemsExport

func (ctrl *V1Controller) HandleItemsExport() errchain.HandlerFunc

HandleItemsExport godocs

@Summary	Export Items
@Tags		Items
@Success	200	{string}	string	"text/csv"
@Router		/v1/items/export [GET]
@Security	Bearer

func (*V1Controller) HandleItemsGetAll

func (ctrl *V1Controller) HandleItemsGetAll() errchain.HandlerFunc

HandleItemsGetAll godoc

@Summary	Query All Items
@Tags		Items
@Produce	json
@Param		q			query		string		false	"search string"
@Param		page		query		int			false	"page number"
@Param		pageSize	query		int			false	"items per page"
@Param		labels		query		[]string	false	"label Ids"		collectionFormat(multi)
@Param		locations	query		[]string	false	"location Ids"	collectionFormat(multi)
@Param		parentIds	query		[]string	false	"parent Ids"	collectionFormat(multi)
@Success	200			{object}	repo.PaginationResult[repo.ItemSummary]{}
@Router		/v1/items [GET]
@Security	Bearer

func (*V1Controller) HandleItemsImport

func (ctrl *V1Controller) HandleItemsImport() errchain.HandlerFunc

HandleItemsImport godocs

@Summary  Import Items
@Tags     Items
@Accept   multipart/form-data
@Produce  json
@Success  204
@Param    csv formData file true "Image to upload"
@Router   /v1/items/import [Post]
@Security Bearer

func (*V1Controller) HandleLabelDelete

func (ctrl *V1Controller) HandleLabelDelete() errchain.HandlerFunc

HandleLabelDelete godocs

@Summary	Delete Label
@Tags		Labels
@Produce	json
@Param		id	path	string	true	"Label ID"
@Success	204
@Router		/v1/labels/{id} [DELETE]
@Security	Bearer

func (*V1Controller) HandleLabelGet

func (ctrl *V1Controller) HandleLabelGet() errchain.HandlerFunc

HandleLabelGet godocs

@Summary	Get Label
@Tags		Labels
@Produce	json
@Param		id	path		string	true	"Label ID"
@Success	200	{object}	repo.LabelOut
@Router		/v1/labels/{id} [GET]
@Security	Bearer

func (*V1Controller) HandleLabelUpdate

func (ctrl *V1Controller) HandleLabelUpdate() errchain.HandlerFunc

HandleLabelUpdate godocs

@Summary	Update Label
@Tags		Labels
@Produce	json
@Param		id	path		string	true	"Label ID"
@Success	200	{object}	repo.LabelOut
@Router		/v1/labels/{id} [PUT]
@Security	Bearer

func (*V1Controller) HandleLabelsCreate

func (ctrl *V1Controller) HandleLabelsCreate() errchain.HandlerFunc

HandleLabelsCreate godoc

@Summary	Create Label
@Tags		Labels
@Produce	json
@Param		payload	body		repo.LabelCreate	true	"Label Data"
@Success	200		{object}	repo.LabelSummary
@Router		/v1/labels [POST]
@Security	Bearer

func (*V1Controller) HandleLabelsGetAll

func (ctrl *V1Controller) HandleLabelsGetAll() errchain.HandlerFunc

HandleLabelsGetAll godoc

@Summary	Get All Labels
@Tags		Labels
@Produce	json
@Success	200	{object}	[]repo.LabelOut
@Router		/v1/labels [GET]
@Security	Bearer

func (*V1Controller) HandleLocationCreate

func (ctrl *V1Controller) HandleLocationCreate() errchain.HandlerFunc

HandleLocationCreate godoc

@Summary	Create Location
@Tags		Locations
@Produce	json
@Param		payload	body		repo.LocationCreate	true	"Location Data"
@Success	200		{object}	repo.LocationSummary
@Router		/v1/locations [POST]
@Security	Bearer

func (*V1Controller) HandleLocationDelete

func (ctrl *V1Controller) HandleLocationDelete() errchain.HandlerFunc

HandleLocationDelete godoc

@Summary	Delete Location
@Tags		Locations
@Produce	json
@Param		id	path	string	true	"Location ID"
@Success	204
@Router		/v1/locations/{id} [DELETE]
@Security	Bearer

func (*V1Controller) HandleLocationGet

func (ctrl *V1Controller) HandleLocationGet() errchain.HandlerFunc

HandleLocationGet godoc

@Summary	Get Location
@Tags		Locations
@Produce	json
@Param		id	path		string	true	"Location ID"
@Success	200	{object}	repo.LocationOut
@Router		/v1/locations/{id} [GET]
@Security	Bearer

func (*V1Controller) HandleLocationGetAll

func (ctrl *V1Controller) HandleLocationGetAll() errchain.HandlerFunc

HandleLocationGetAll godoc

@Summary	Get All Locations
@Tags		Locations
@Produce	json
@Param		filterChildren	query		bool	false	"Filter locations with parents"
@Success	200				{object}	[]repo.LocationOutCount
@Router		/v1/locations [GET]
@Security	Bearer

func (*V1Controller) HandleLocationTreeQuery

func (ctrl *V1Controller) HandleLocationTreeQuery() errchain.HandlerFunc

HandleLocationTreeQuery godoc

@Summary	Get Locations Tree
@Tags		Locations
@Produce	json
@Param		withItems	query		bool	false	"include items in response tree"
@Success	200			{object}	[]repo.TreeItem
@Router		/v1/locations/tree [GET]
@Security	Bearer

func (*V1Controller) HandleLocationUpdate

func (ctrl *V1Controller) HandleLocationUpdate() errchain.HandlerFunc

HandleLocationUpdate godoc

@Summary	Update Location
@Tags		Locations
@Produce	json
@Param		id		path		string				true	"Location ID"
@Param		payload	body		repo.LocationUpdate	true	"Location Data"
@Success	200		{object}	repo.LocationOut
@Router		/v1/locations/{id} [PUT]
@Security	Bearer

func (*V1Controller) HandleMaintenanceEntryCreate

func (ctrl *V1Controller) HandleMaintenanceEntryCreate() errchain.HandlerFunc

HandleMaintenanceEntryCreate godoc

@Summary  Create Maintenance Entry
@Tags     Item Maintenance
@Produce  json
@Param    id  path     string true "Item ID"
@Param    payload body     repo.MaintenanceEntryCreate true "Entry Data"
@Success  201     {object} repo.MaintenanceEntry
@Router   /v1/items/{id}/maintenance [POST]
@Security Bearer

func (*V1Controller) HandleMaintenanceEntryDelete

func (ctrl *V1Controller) HandleMaintenanceEntryDelete() errchain.HandlerFunc

HandleMaintenanceEntryDelete godoc

@Summary  Delete Maintenance Entry
@Tags     Maintenance
@Produce  json
@Param    id  path     string true "Maintenance ID"
@Success  204
@Router   /v1/maintenance/{id} [DELETE]
@Security Bearer

func (*V1Controller) HandleMaintenanceEntryUpdate

func (ctrl *V1Controller) HandleMaintenanceEntryUpdate() errchain.HandlerFunc

HandleMaintenanceEntryUpdate godoc

@Summary  Update Maintenance Entry
@Tags     Maintenance
@Produce  json
@Param    id  path     string true "Maintenance ID"
@Param    payload body     repo.MaintenanceEntryUpdate true "Entry Data"
@Success  200     {object} repo.MaintenanceEntry
@Router   /v1/maintenance/{id} [PUT]
@Security Bearer

func (*V1Controller) HandleMaintenanceGetAll

func (ctrl *V1Controller) HandleMaintenanceGetAll() errchain.HandlerFunc

HandleMaintenanceGetAll godoc

@Summary	Query All Maintenance
@Tags		Maintenance
@Produce	json
@Param		filters	query	repo.MaintenanceFilters	false	"which maintenance to retrieve"
@Success	200		{array}	repo.MaintenanceEntryWithDetails[]
@Router		/v1/maintenance [GET]
@Security	Bearer

func (*V1Controller) HandleMaintenanceLogGet

func (ctrl *V1Controller) HandleMaintenanceLogGet() errchain.HandlerFunc

HandleMaintenanceLogGet godoc

@Summary  Get Maintenance Log
@Tags     Item Maintenance
@Produce  json
@Param    id  path     string true "Item ID"
@Param    filters query    repo.MaintenanceFilters     false "which maintenance to retrieve"
@Success  200       {array} repo.MaintenanceEntryWithDetails[]
@Router   /v1/items/{id}/maintenance [GET]
@Security Bearer

func (*V1Controller) HandleSetPrimaryPhotos

func (ctrl *V1Controller) HandleSetPrimaryPhotos() errchain.HandlerFunc

HandleSetPrimaryPhotos godoc

@Summary		Set Primary Photos
@Description	Sets the first photo of each item as the primary photo
@Tags			Actions
@Produce		json
@Success		200	{object}	ActionAmountResult
@Router			/v1/actions/set-primary-photos [Post]
@Security		Bearer

func (*V1Controller) HandleUpdateNotifier

func (ctrl *V1Controller) HandleUpdateNotifier() errchain.HandlerFunc

HandleUpdateNotifier godocs

@Summary	Update Notifier
@Tags		Notifiers
@Param		id		path		string				true	"Notifier ID"
@Param		payload	body		repo.NotifierUpdate	true	"Notifier Data"
@Success	200		{object}	repo.NotifierOut
@Router		/v1/notifiers/{id} [PUT]
@Security	Bearer

func (*V1Controller) HandleUserRegistration

func (ctrl *V1Controller) HandleUserRegistration() errchain.HandlerFunc

HandleUserRegistration godoc

@Summary	Register New User
@Tags		User
@Produce	json
@Param		payload	body	services.UserRegistration	true	"User Data"
@Success	204
@Router		/v1/users/register [Post]

func (*V1Controller) HandleUserSelf

func (ctrl *V1Controller) HandleUserSelf() errchain.HandlerFunc

HandleUserSelf godoc

@Summary	Get User Self
@Tags		User
@Produce	json
@Success	200	{object}	Wrapped{item=repo.UserOut}
@Router		/v1/users/self [GET]
@Security	Bearer

func (*V1Controller) HandleUserSelfChangePassword

func (ctrl *V1Controller) HandleUserSelfChangePassword() errchain.HandlerFunc

HandleUserSelfChangePassword godoc

@Summary	Change Password
@Tags		User
@Success	204
@Param		payload	body	ChangePassword	true	"Password Payload"
@Router		/v1/users/change-password [PUT]
@Security	Bearer

func (*V1Controller) HandleUserSelfDelete

func (ctrl *V1Controller) HandleUserSelfDelete() errchain.HandlerFunc

HandleUserSelfDelete godoc

@Summary	Delete Account
@Tags		User
@Produce	json
@Success	204
@Router		/v1/users/self [DELETE]
@Security	Bearer

func (*V1Controller) HandleUserSelfUpdate

func (ctrl *V1Controller) HandleUserSelfUpdate() errchain.HandlerFunc

HandleUserSelfUpdate godoc

@Summary	Update Account
@Tags		User
@Produce	json
@Param		payload	body		repo.UserUpdate	true	"User Data"
@Success	200		{object}	Wrapped{item=repo.UserUpdate}
@Router		/v1/users/self [PUT]
@Security	Bearer

func (*V1Controller) HandlerNotifierTest

func (ctrl *V1Controller) HandlerNotifierTest() errchain.HandlerFunc

HandlerNotifierTest godoc

@Summary  Test Notifier
@Tags     Notifiers
@Produce  json
@Param url query string true "URL"
@Success  204
@Router   /v1/notifiers/test [POST]
@Security Bearer

type Wrapped

type Wrapped struct {
	Item interface{} `json:"item"`
}

func Wrap

func Wrap(v any) Wrapped

Jump to

Keyboard shortcuts

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