Documentation
¶
Overview ¶
Package common contains shared domain models used across the application.
Package common contains shared domain models used across the application.
Package common contains shared domain models used across the application.
Package common contains shared domain models used across the application.
Package common contains shared domain models used across the application.
Package common contains shared domain models used across the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCollectionNotFound indicates a requested collection was not found. ErrCollectionNotFound = errors.New("collection not found") // ErrUserNotFound indicates an authenticated user was not found in context or storage. ErrUserNotFound = errors.New("user not found") // ErrExpiredToken indicates the provided JWT has already expired. ErrExpiredToken = errors.New("token already expired") // ErrInvalidToken indicates the provided JWT is malformed or invalid. ErrInvalidToken = errors.New("token invalid") // ErrQRRecordNotExist indicates a QR record does not exist. ErrQRRecordNotExist = errors.New("qr record not exist") // ErrJwtIncorrect indicates an incorrect or missing JWT in request headers. ErrJwtIncorrect = errors.New("invalid jwt") // ErrDeviceNotFound indicates a device was not found for the given identifier. ErrDeviceNotFound = errors.New("device not found") ErrUnauthorized = errors.New("unauthenticated") // ErrNotAdmin indicates the authenticated principal lacks admin privileges. ErrNotAdmin = errors.New("forbidden: admin required") )
var BeverageTypeStringMap = map[BeverageType]string{ TeaBeverageType: "tea", HerbBeverageType: "herb", CoffeeBeverageType: "coffee", OtherBeverageType: "other", }
BeverageTypeStringMap maps BeverageType values to their string representations.
Functions ¶
This section is empty.
Types ¶
type BeverageType ¶
type BeverageType int
BeverageType categorizes beverages like tea, herb, coffee, or other.
const ( // TeaBeverageType represents traditional tea beverages. TeaBeverageType BeverageType = iota // HerbBeverageType represents herbal infusions/additives. HerbBeverageType // CoffeeBeverageType represents coffee beverages. CoffeeBeverageType // OtherBeverageType represents any other beverage type. OtherBeverageType )
BeverageType enumerations define available beverage categories.
func StringToBeverageType ¶
func StringToBeverageType(str string) BeverageType
StringToBeverageType converts a string label to a BeverageType, defaulting to OtherBeverageType.
func (BeverageType) String ¶
func (b BeverageType) String() string
type Collection ¶
Collection represents a user-defined grouping of QR tea records.
type CollectionRecord ¶
CollectionRecord represents a QR-coded tea item tracked in a Collection.
type Notification ¶
type Notification struct {
UserID uuid.UUID
Type NotificationType
}
Notification describes a notification event for a user.
type NotificationType ¶
type NotificationType int
NotificationType is the domain-level enum of notification categories.
const ( // NotificationTypeTeaExpiration notifies about upcoming tea expiration. NotificationTypeTeaExpiration NotificationType = iota // NotificationTypeTeaRecommendation suggests a tea to drink. NotificationTypeTeaRecommendation )
NotificationType enumerates the kinds of notifications that can be sent to users.
type TagCategory ¶
TagCategory represents a category to which tags belong (e.g., flavor, origin).
type TeaData ¶
type TeaData struct {
Name string `json:"name"`
Type BeverageType `json:"type"`
Description string `json:"description"`
}
TeaData holds descriptive fields for a tea beverage.