packs

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPackNotFound is returned when a pack is not found
	ErrPackNotFound = errors.New("pack not found")

	// ErrPackContentNotFound is returned when no items are found in a given pack
	ErrPackContentNotFound = errors.New("pack content not found")

	// ErrPackNotOwned is returned when a user tries to operate on a pack they don't own
	ErrPackNotOwned = errors.New("pack does not belong to user")
)

Domain errors

Functions

func CheckItemInPack added in v1.7.0

func CheckItemInPack(ctx context.Context, packID uint, itemID uint) (bool, error)

CheckItemInPack verifies if an inventory item is part of a pack's contents

func CheckPackOwnership added in v0.14.0

func CheckPackOwnership(ctx context.Context, packID uint, userID uint) (bool, error)

CheckPackOwnership verifies if a user owns a specific pack This is a public service function used by other packages (e.g., images)

func DeleteMyPackByID

func DeleteMyPackByID(c *gin.Context)

Delete a pack by ID @Summary Delete a pack by ID @Description Delete a pack by ID @Security Bearer @Tags Packs @Produce json @Param id path int true "Pack ID" @Success 200 {object} apitypes.OkResponse "Pack deleted" @Failure 400 {object} apitypes.ErrorResponse "Invalid ID format" @Failure 401 {object} apitypes.ErrorResponse "Unauthorized" @Failure 403 {object} apitypes.ErrorResponse "This pack does not belong to you" @Failure 500 {object} apitypes.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id} [delete]

func DeleteMyPackContentByID

func DeleteMyPackContentByID(c *gin.Context)

Delete a pack content ID by Pack ID @Summary Delete a pack content by ID @Description Delete a pack content by ID @Security Bearer @Tags Packs @Produce json @Param id path int true "Pack ID" @Param item_id path int true "Item ID" @Success 200 {object} apitypes.OkResponse "Pack Item deleted" @Failure 400 {object} apitypes.ErrorResponse "Invalid ID format" @Failure 401 {object} apitypes.ErrorResponse "Unauthorized" @Failure 403 {object} apitypes.ErrorResponse "This pack does not belong to you" @Failure 500 {object} apitypes.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id}/packcontent/{item_id} [delete]

func DeletePackByID

func DeletePackByID(c *gin.Context)

func DeletePackContentByID

func DeletePackContentByID(c *gin.Context)

Delete a pack content by ID @Summary [ADMIN] Delete a pack content by ID @Description Delete a pack content by ID - for admin use only @Security Bearer @Tags Internal @Produce json @Param id path int true "Pack Content ID" @Success 200 {object} map[string]string "message" @Failure 400 {object} apitypes.ErrorResponse @Failure 500 {object} apitypes.ErrorResponse @Router /admin/packcontents/{id} [delete]

func FavoriteMyPack added in v1.1.0

func FavoriteMyPack(c *gin.Context)

Favorite a pack by ID @Summary Favorite a pack by ID @Description Mark a pack as favorite. Only one pack per user can be favorite at a time (idempotent) @Security Bearer @Tags Packs @Produce json @Param id path int true "Pack ID" @Success 200 {object} apitypes.OkResponse "Pack favorited successfully" @Failure 400 {object} apitypes.ErrorResponse "Invalid ID format" @Failure 401 {object} apitypes.ErrorResponse "Unauthorized" @Failure 403 {object} apitypes.ErrorResponse "This pack does not belong to you" @Failure 404 {object} apitypes.ErrorResponse "Pack not found" @Failure 500 {object} apitypes.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id}/favorite [post]

func FindPackIDByPackName added in v0.15.0

func FindPackIDByPackName(packs Packs, packname string) uint

FindPackIDByPackName finds a pack ID by its name Returns 0 if not found

func GetMyPackByID

func GetMyPackByID(c *gin.Context)

Get My pack by ID @Summary Get My pack by ID @Description Get pack by ID @Security Bearer @Tags Packs @Produce json @Param id path int true "Pack ID" @Success 200 {object} Pack @Failure 400 {object} apitypes.ErrorResponse "Invalid ID format" @Failure 401 {object} apitypes.ErrorResponse "Unauthorized" @Failure 403 {object} apitypes.ErrorResponse "This pack does not belong to you" @Failure 404 {object} apitypes.ErrorResponse "Pack not found" @Failure 500 {object} apitypes.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id} [get]

func GetMyPackContentsByPackID

func GetMyPackContentsByPackID(c *gin.Context)

Get pack content by ID @Summary Get pack content by ID @Description Get pack content by ID @Security Bearer @Tags Packs @Produce json @Param id path int true "Pack Content ID" @Success 200 {object} PackContent "Pack Item" @Failure 400 {object} apitypes.ErrorResponse "Invalid ID format" @Failure 401 {object} apitypes.ErrorResponse "Unauthorized" @Failure 403 {object} apitypes.ErrorResponse "This pack does not belong to you" @Failure 404 {object} apitypes.ErrorResponse "Pack not found" @Failure 500 {object} apitypes.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id}/packcontents [get]

func GetMyPacks

func GetMyPacks(c *gin.Context)

Get My packs @Summary Get My Packs @Description Get my packs @Security Bearer @Tags Packs @Produce json @Success 200 {object} Packs "Packs" @Failure 401 {object} apitypes.ErrorResponse "Unauthorized" @Failure 404 {object} apitypes.ErrorResponse "No pack found" @Failure 500 {object} apitypes.ErrorResponse "Internal Server Error" @Router /v1/mypacks [get]

func GetPackByID

func GetPackByID(c *gin.Context)

Get pack by ID @Summary [ADMIN] Get pack by ID @Description Get pack by ID - for admin use only @Security Bearer @Tags Internal @Produce json @Param id path int true "Pack ID" @Success 200 {object} Pack @Failure 400 {object} apitypes.ErrorResponse "Invalid ID format" @Failure 404 {object} apitypes.ErrorResponse "Pack not found" @Failure 500 {object} apitypes.ErrorResponse "Internal Server Error" @Router /admin/packs/{id} [get]

func GetPackContentByID

func GetPackContentByID(c *gin.Context)

Get pack content by ID @Summary [ADMIN] Get pack content by ID @Description Get pack content by ID - for admin use only @Security Bearer @Tags Internal @Produce json @Param id path int true "Pack Content ID" @Success 200 {object} PackContent @Failure 400 {object} apitypes.ErrorResponse @Failure 404 {object} apitypes.ErrorResponse @Failure 500 {object} apitypes.ErrorResponse @Router /admin/packcontents/{id} [get]

func GetPackContents

func GetPackContents(c *gin.Context)

Get all pack contents @Summary [ADMIN] Get all pack contents @Description Get all pack contents - for admin use only @Security Bearer @Tags Internal @Produce json @Success 200 {object} PackContents @Failure 500 {object} apitypes.ErrorResponse @Router /admin/packcontents [get]

func GetPackContentsByPackID

func GetPackContentsByPackID(c *gin.Context)

Get all pack contents @Summary [ADMIN] Get all pack contents @Description Get all pack contents - for admin use only @Security Bearer @Tags Internal @Produce json @Success 200 {object} PackContents @Failure 400 {object} apitypes.ErrorResponse @Failure 404 {object} apitypes.ErrorResponse @Failure 500 {object} apitypes.ErrorResponse @Router /admin/packs/:id/packcontents [get]

func GetPackOptions added in v1.3.0

func GetPackOptions(c *gin.Context)

Get pack options @Summary Get allowed values for pack metadata @Description Returns the allowed values for season, trail, and adventure fields @Tags Packs @Produce json @Security Bearer @Success 200 {object} PackOptionsResponse @Router /v1/pack-options [get]

func GetPackOptionsV2 added in v1.7.0

func GetPackOptionsV2(c *gin.Context)

Get V2 pack options with grouped trails @Summary Get allowed values for pack metadata (V2) @Description Returns the allowed values for season, trail (grouped by continent/country), and adventure fields @Tags Packs @Produce json @Security Bearer @Success 200 {object} PackOptionsV2Response @Router /v2/pack-options [get]

func GetPacks

func GetPacks(c *gin.Context)

Get all packs @Summary [ADMIN] Get all packs @Description Get all packs - for admin use only @Security Bearer @Tags Internal @Produce json @Success 200 {object} Packs @Failure 500 {object} apitypes.ErrorResponse @Router /admin/packs [get]

func ImportFromLighterPack

func ImportFromLighterPack(c *gin.Context)

Import from lighterpack @Summary Import from lighterpack csv pack file @Description Import from lighterpack csv pack file @Security Bearer @Tags Packs @Accept multipart/form-data @Produce json @Param file formData file true "CSV file" @Success 200 {object} ImportExternalPackResponse "CSV data imported successfully with pack ID" @Failure 400 {object} apitypes.ErrorResponse "Invalid CSV format" @Failure 401 {object} apitypes.ErrorResponse "Unauthorized" @Failure 500 {object} apitypes.ErrorResponse "Internal Server Error" @Router /v1/importfromlighterpack [post]

func ImportFromLighterPackURL added in v1.5.0

func ImportFromLighterPackURL(c *gin.Context)

Import from LighterPack URL @Summary Import a pack from a LighterPack sharing URL @Description Import items from a LighterPack sharing URL into a new pack @Tags Packs @Accept json @Produce json @Security Bearer @Param input body ImportFromURLRequest true "LighterPack URL" @Success 200 {object} ImportExternalPackResponse @Failure 400 {object} apitypes.ErrorResponse "Invalid URL" @Failure 422 {object} apitypes.ErrorResponse "Failed to parse page" @Failure 502 {object} apitypes.ErrorResponse "Failed to fetch page" @Router /v1/importfromlighterpackurl [post]

func ImportFromPimpMyPackURL added in v1.5.0

func ImportFromPimpMyPackURL(c *gin.Context)

Import from PimpMyPack URL @Summary Import a pack from a PimpMyPack sharing URL @Description Import items from a PimpMyPack sharing URL into a new pack @Tags Packs @Accept json @Produce json @Security Bearer @Param input body ImportFromURLRequest true "PimpMyPack URL" @Success 200 {object} ImportExternalPackResponse @Failure 400 {object} apitypes.ErrorResponse "Invalid URL" @Failure 404 {object} apitypes.ErrorResponse "Shared pack not found" @Failure 500 {object} apitypes.ErrorResponse "Internal Server Error" @Router /v1/importfrompimpmypackurl [post]

func PostMyPack

func PostMyPack(c *gin.Context)

Create a new pack @Summary Create a new pack @Description Create a new pack @Security Bearer @Tags Packs @Accept json @Produce json @Param pack body PackCreateRequest true "Pack" @Success 201 {object} Pack "Pack created" @Failure 400 {object} apitypes.ErrorResponse "Invalid Body format" @Failure 401 {object} apitypes.ErrorResponse "Unauthorized" @Failure 500 {object} apitypes.ErrorResponse "Internal Server Error" @Router /v1/mypack [post]

func PostMyPackContent

func PostMyPackContent(c *gin.Context)

Create a new pack content @Summary Create a new pack content @Description Create a new pack content @Security Bearer @Tags Packs @Accept json @Produce json @Param packcontent body PackContent true "Pack Content" @Success 201 {object} PackContent @Failure 400 {object} apitypes.ErrorResponse @Failure 401 {object} apitypes.ErrorResponse @Failure 403 {object} apitypes.ErrorResponse @Failure 500 {object} apitypes.ErrorResponse @Router /v1/mypack/:id/packcontent [post]

func PostPack

func PostPack(c *gin.Context)

Create a new pack @Summary [ADMIN] Create a new pack @Description Create a new pack - for admin use only @Security Bearer @Tags Internal @Accept json @Produce json @Param pack body PackCreateAdminRequest true "Pack" @Success 201 {object} Pack @Failure 400 {object} apitypes.ErrorResponse @Failure 500 {object} apitypes.ErrorResponse @Router /admin/packs [post]

func PostPackContent

func PostPackContent(c *gin.Context)

Create a new pack content @Summary [ADMIN] Create a new pack content @Description Create a new pack content - for admin use only @Security Bearer @Tags Internal @Accept json @Produce json @Param packcontent body PackContentCreateRequest true "Pack Content" @Success 201 {object} PackContent @Failure 400 {object} apitypes.ErrorResponse @Failure 500 {object} apitypes.ErrorResponse @Router /admin/packcontents [post]

func PutMyPackByID

func PutMyPackByID(c *gin.Context)

Update a pack by ID @Summary Update a pack by ID @Description Update a pack by ID @Security Bearer @Tags Packs @Accept json @Produce json @Param id path int true "Pack ID" @Param pack body PackUpdateRequest true "Pack" @Success 200 {object} Pack "Pack updated" @Failure 400 {object} apitypes.ErrorResponse "Invalid ID format" @Failure 400 {object} apitypes.ErrorResponse "Invalid Payload" @Failure 401 {object} apitypes.ErrorResponse "Unauthorized" @Failure 403 {object} apitypes.ErrorResponse "This pack does not belong to you" @Failure 500 {object} apitypes.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id} [put]

func PutMyPackContentByID

func PutMyPackContentByID(c *gin.Context)

Update My pack content ID by Pack ID @Summary Update My pack content ID by Pack ID @Description Update My pack content ID by Pack ID @Security Bearer @Tags Packs @Accept json @Produce json @Param id path int true "Pack ID" @Param item_id path int true "Item ID" @Param packcontent body PackContentRequest true "Pack Content" @Success 200 {object} PackContent "Pack Content updated" @Failure 400 {object} apitypes.ErrorResponse "Invalid ID format" @Failure 400 {object} apitypes.ErrorResponse "Invalid Body format" @Failure 401 {object} apitypes.ErrorResponse "Unauthorized" @Failure 403 {object} apitypes.ErrorResponse "This pack does not belong to you" @Failure 500 {object} apitypes.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id}/packcontent/{item_id} [put]

func PutPackByID

func PutPackByID(c *gin.Context)

Update a pack by ID @Summary [ADMIN] Update a pack by ID @Description Update a pack by ID - for admin use only @Security Bearer @Tags Internal @Accept json @Produce json @Param id path int true "Pack ID" @Param pack body PackUpdateRequest true "Pack" @Success 200 {object} Pack @Failure 400 {object} apitypes.ErrorResponse @Failure 500 {object} apitypes.ErrorResponse @Router /admin/packs/{id} [put]

func PutPackContentByID

func PutPackContentByID(c *gin.Context)

Update a pack content by ID @Summary [ADMIN] Update a pack content by ID @Description Update a pack content by ID - for admin use only @Security Bearer @Tags Internal @Accept json @Produce json @Param id path int true "Pack Content ID" @Param packcontent body PackContentUpdateRequest true "Pack Content" @Success 200 {object} PackContent @Failure 400 {object} apitypes.ErrorResponse @Failure 500 {object} apitypes.ErrorResponse @Router /admin/packcontents/{id} [put]

func ShareMyPack added in v0.11.0

func ShareMyPack(c *gin.Context)

Share a pack by ID @Summary Share a pack by ID @Description Generate a sharing code for a pack to make it publicly accessible (idempotent) @Security Bearer @Tags Packs @Produce json @Param id path int true "Pack ID" @Success 200 {object} map[string]string "Pack shared successfully" @Failure 400 {object} apitypes.ErrorResponse "Invalid ID format" @Failure 401 {object} apitypes.ErrorResponse "Unauthorized" @Failure 403 {object} apitypes.ErrorResponse "This pack does not belong to you" @Failure 404 {object} apitypes.ErrorResponse "Pack not found" @Failure 500 {object} apitypes.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id}/share [post]

func SharedList added in v0.4.0

func SharedList(c *gin.Context)

SharedList gets pack metadata and contents for a shared pack @Summary Get shared pack with metadata @Description Retrieves pack metadata and contents using a sharing code @Tags Public @Accept json @Produce json @Param sharing_code path string true "Pack sharing code" @Success 200 {object} SharedPackResponse "Shared pack with metadata and contents" @Failure 404 {object} apitypes.ErrorResponse "Pack not found or not shared" @Failure 500 {object} apitypes.ErrorResponse "Internal server error" @Router /sharedlist/{sharing_code} [get]

func UnfavoriteMyPack added in v1.1.0

func UnfavoriteMyPack(c *gin.Context)

Unfavorite a pack by ID @Summary Unfavorite a pack by ID @Description Remove favorite status from a pack (idempotent) @Security Bearer @Tags Packs @Produce json @Param id path int true "Pack ID" @Success 200 {object} apitypes.OkResponse "Pack unfavorited successfully" @Failure 400 {object} apitypes.ErrorResponse "Invalid ID format" @Failure 401 {object} apitypes.ErrorResponse "Unauthorized" @Failure 403 {object} apitypes.ErrorResponse "This pack does not belong to you" @Failure 404 {object} apitypes.ErrorResponse "Pack not found" @Failure 500 {object} apitypes.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id}/favorite [delete]

func UnshareMyPack added in v0.11.0

func UnshareMyPack(c *gin.Context)

Unshare a pack by ID @Summary Unshare a pack by ID @Description Remove the sharing code from a pack to make it private (idempotent) @Security Bearer @Tags Packs @Produce json @Param id path int true "Pack ID" @Success 200 {object} apitypes.OkResponse "Pack unshared successfully" @Failure 400 {object} apitypes.ErrorResponse "Invalid ID format" @Failure 401 {object} apitypes.ErrorResponse "Unauthorized" @Failure 403 {object} apitypes.ErrorResponse "This pack does not belong to you" @Failure 404 {object} apitypes.ErrorResponse "Pack not found" @Failure 500 {object} apitypes.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id}/share [delete]

Types

type ExternalPack added in v1.5.0

type ExternalPack []ExternalPackItem

ExternalPack represents a collection of external pack items

type ExternalPackItem added in v1.5.0

type ExternalPackItem struct {
	ItemName   string `json:"item_name"`
	Category   string `json:"category"`
	Desc       string `json:"desc"`
	Qty        int    `json:"qty"`
	Weight     int    `json:"weight"`
	Unit       string `json:"unit"`
	URL        string `json:"url"`
	Price      int    `json:"price"`
	Currency   string `json:"currency"`
	Worn       bool   `json:"worn"`
	Consumable bool   `json:"consumable"`
}

ExternalPackItem represents an item imported from an external source (LighterPack, PimpMyPack, etc.)

type ImportExternalPackResponse added in v1.5.0

type ImportExternalPackResponse struct {
	Message string `json:"message"`
	PackID  uint   `json:"pack_id"`
}

ImportExternalPackResponse represents the response when importing from an external source

type ImportFromURLRequest added in v1.5.0

type ImportFromURLRequest struct {
	URL string `json:"url" binding:"required"`
}

ImportFromURLRequest represents the request body for importing from a LighterPack URL

type Pack added in v0.15.0

type Pack struct {
	ID              uint      `json:"id"`
	UserID          uint      `json:"user_id"`
	PackName        string    `json:"pack_name"`
	PackDescription string    `json:"pack_description"`
	PackWeight      int       `json:"pack_weight"`
	PackItemsCount  int       `json:"pack_items_count"`
	SharingCode     *string   `json:"sharing_code,omitempty"`
	IsFavorite      bool      `json:"is_favorite"`
	HasImage        bool      `json:"has_image"`
	Season          *string   `json:"season,omitempty"`
	Trail           *string   `json:"trail,omitempty"`
	TrailID         *uint     `json:"trail_id,omitempty"`
	Adventure       *string   `json:"adventure,omitempty"`
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
}

Pack represents a pack with its metadata

func FindPackByID added in v0.14.0

func FindPackByID(ctx context.Context, id uint) (*Pack, error)

FindPackByID finds a pack by its ID This is a public service function used by other packages (e.g., images)

type PackContent added in v0.15.0

type PackContent struct {
	ID         uint      `json:"id"`
	PackID     uint      `json:"pack_id"`
	ItemID     uint      `json:"item_id"`
	Quantity   int       `json:"quantity"`
	Worn       bool      `json:"worn"`
	Consumable bool      `json:"consumable"`
	CreatedAt  time.Time `json:"created_at"`
	UpdatedAt  time.Time `json:"updated_at"`
}

PackContent represents an item in a pack

type PackContentCreateRequest added in v1.0.0

type PackContentCreateRequest struct {
	PackID     uint `json:"pack_id" binding:"required"`
	ItemID     uint `json:"item_id" binding:"required"`
	Quantity   int  `json:"quantity" binding:"required,min=1"`
	Worn       bool `json:"worn"`
	Consumable bool `json:"consumable"`
}

PackContentCreateRequest represents the input for creating pack content (admin) Note: User endpoint uses PackContentRequest which doesn't include PackID/ItemID

type PackContentRequest added in v0.15.0

type PackContentRequest struct {
	InventoryID uint `json:"inventory_id" binding:"required"`
	Quantity    int  `json:"quantity" binding:"required,min=1"`
	Worn        bool `json:"worn"`
	Consumable  bool `json:"consumable"`
}

PackContentRequest represents the data required to add an item to a pack

type PackContentUpdateRequest added in v1.0.0

type PackContentUpdateRequest struct {
	PackID     uint `json:"pack_id" binding:"required"`
	ItemID     uint `json:"item_id" binding:"required"`
	Quantity   int  `json:"quantity" binding:"required,min=1"`
	Worn       bool `json:"worn"`
	Consumable bool `json:"consumable"`
}

PackContentUpdateRequest represents the input for updating pack content

type PackContentWithItem added in v0.15.0

type PackContentWithItem struct {
	PackContentID   uint   `json:"pack_content_id"`
	PackID          uint   `json:"pack_id"`
	InventoryID     uint   `json:"inventory_id"`
	ItemName        string `json:"item_name"`
	Category        string `json:"category"`
	ItemDescription string `json:"item_description"`
	Weight          int    `json:"weight"`
	ItemURL         string `json:"item_url"`
	Price           int    `json:"price"`
	Currency        string `json:"currency"`
	Quantity        int    `json:"quantity"`
	Worn            bool   `json:"worn"`
	Consumable      bool   `json:"consumable"`
	HasImage        bool   `json:"has_image"`
}

PackContentWithItem represents a pack content with inventory item details

type PackContentWithItems added in v0.15.0

type PackContentWithItems []PackContentWithItem

PackContentWithItems represents a collection of pack contents with item details

type PackContents added in v0.15.0

type PackContents []PackContent

PackContents represents a collection of pack contents

type PackCreateAdminRequest added in v1.0.0

type PackCreateAdminRequest struct {
	UserID          uint    `json:"user_id" binding:"required"`
	PackName        string  `json:"pack_name" binding:"required"`
	PackDescription string  `json:"pack_description"`
	Season          *string `json:"season"`
	Trail           *string `json:"trail"`
	Adventure       *string `json:"adventure"`
}

PackCreateAdminRequest represents the input for creating a pack (admin endpoint)

type PackCreateRequest added in v1.0.0

type PackCreateRequest struct {
	PackName        string  `json:"pack_name" binding:"required"`
	PackDescription string  `json:"pack_description"`
	Season          *string `json:"season"`
	Trail           *string `json:"trail"`
	Adventure       *string `json:"adventure"`
}

PackCreateRequest represents the input for creating a pack (user endpoint)

type PackOptionsResponse added in v1.3.0

type PackOptionsResponse struct {
	Seasons    []string `json:"seasons"`
	Trails     []string `json:"trails"`
	Adventures []string `json:"adventures"`
}

PackOptionsResponse represents the allowed values for pack metadata fields

func GetPackOptionsValues added in v1.3.0

func GetPackOptionsValues(ctx context.Context) (PackOptionsResponse, error)

GetPackOptionsValues returns the allowed metadata values, querying the DB for trails

type PackOptionsV2Response added in v1.7.0

type PackOptionsV2Response struct {
	Seasons    []string                                    `json:"seasons"`
	Trails     map[string]map[string][]trails.TrailSummary `json:"trails"`
	Adventures []string                                    `json:"adventures"`
}

PackOptionsV2Response represents the V2 allowed values with grouped trails

func GetPackOptionsV2Values added in v1.7.0

func GetPackOptionsV2Values(ctx context.Context) (PackOptionsV2Response, error)

GetPackOptionsV2Values returns the allowed metadata values with trails grouped by continent/country

type PackUpdateRequest added in v1.0.0

type PackUpdateRequest struct {
	PackName        string  `json:"pack_name" binding:"required"`
	PackDescription string  `json:"pack_description"`
	Season          *string `json:"season"`
	Trail           *string `json:"trail"`
	Adventure       *string `json:"adventure"`
}

PackUpdateRequest represents the input for updating a pack

type Packs added in v0.15.0

type Packs []Pack

Packs represents a collection of packs

type SharedPackInfo added in v0.15.0

type SharedPackInfo struct {
	ID              uint      `json:"id"`
	PackName        string    `json:"pack_name"`
	PackDescription string    `json:"pack_description"`
	HasImage        bool      `json:"has_image"`
	Season          *string   `json:"season,omitempty"`
	Trail           *string   `json:"trail,omitempty"`
	Adventure       *string   `json:"adventure,omitempty"`
	CreatedAt       time.Time `json:"created_at"`
}

SharedPackInfo contains public metadata about a shared pack UserID and SharingCode are intentionally not included for security Note: pack_items_count is not included as it doesn't exist in DB schema Clients can count items from the contents array

type SharedPackResponse added in v0.15.0

type SharedPackResponse struct {
	Pack     SharedPackInfo       `json:"pack"`
	Contents PackContentWithItems `json:"contents"`
}

SharedPackResponse represents the response structure for shared pack endpoint

Jump to

Keyboard shortcuts

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