model

package
v1.4.13 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package model contains GraphQL models and helpers for API v2.

Package model contains GraphQL models and helpers for API v2.

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Collection

type Collection struct {
	ID      common.ID   `json:"id"`
	Name    string      `json:"name"`
	UserID  common.ID   `json:"userID"`
	Records []*QRRecord `json:"records"`
}

type Mutation added in v1.3.0

type Mutation struct {
}

type Notification

type Notification struct {
	Type NotificationType `json:"type"`
}

type NotificationType

type NotificationType string
const (
	NotificationTypeUnknown           NotificationType = "unknown"
	NotificationTypeTeaExpiration     NotificationType = "teaExpiration"
	NotificationTypeTeaRecommendation NotificationType = "teaRecommendation"
)

func (*NotificationType) FromCommon

func (t *NotificationType) FromCommon(data common.NotificationType)

FromCommon converts a common.NotificationType to the GraphQL NotificationType.

func (NotificationType) IsValid

func (e NotificationType) IsValid() bool

func (NotificationType) MarshalGQL

func (e NotificationType) MarshalGQL(w io.Writer)

func (NotificationType) MarshalJSON added in v1.3.0

func (e NotificationType) MarshalJSON() ([]byte, error)

func (NotificationType) String

func (e NotificationType) String() string

func (*NotificationType) UnmarshalGQL

func (e *NotificationType) UnmarshalGQL(v any) error

func (*NotificationType) UnmarshalJSON added in v1.3.0

func (e *NotificationType) UnmarshalJSON(b []byte) error

type QRRecord

type QRRecord struct {
	ID             common.ID `json:"id"`
	Tea            *Tea      `json:"tea"`
	BowlingTemp    int       `json:"bowlingTemp"`
	ExpirationDate time.Time `json:"expirationDate"`
}

type QRRecordData

type QRRecordData struct {
	Tea            common.ID `json:"tea"`
	BowlingTemp    int       `json:"bowlingTemp"`
	ExpirationDate time.Time `json:"expirationDate"`
}

type Query added in v1.3.0

type Query struct {
}

type Session

type Session struct {
	Token     string    `json:"token"`
	ExpiredAt time.Time `json:"expiredAt"`
}

type Subscription added in v1.3.0

type Subscription struct {
}

type Tag

type Tag struct {
	ID       common.ID    `json:"id"`
	Name     string       `json:"name"`
	Color    string       `json:"color"`
	Category *TagCategory `json:"category"`
}

type TagCategory

type TagCategory struct {
	ID   common.ID `json:"id"`
	Name string    `json:"name"`
	Tags []*Tag    `json:"tags"`
}

type Tea

type Tea struct {
	ID          common.ID `json:"id"`
	Name        string    `json:"name"`
	Type        Type      `json:"type"`
	Description string    `json:"description"`
	Tags        []*Tag    `json:"tags"`
}

func FromCommonTea

func FromCommonTea(source *common.Tea) *Tea

FromCommonTea converts a common.Tea into a GraphQL Tea.

func (*Tea) ToCommonTea

func (t *Tea) ToCommonTea() common.Tea

ToCommonTea converts a GraphQL Tea into a common.Tea.

type TeaData

type TeaData struct {
	Name        string `json:"name"`
	Type        Type   `json:"type"`
	Description string `json:"description"`
}

func (*TeaData) ToCommonTeaData

func (t *TeaData) ToCommonTeaData() *common.TeaData

ToCommonTeaData converts GraphQL TeaData into a common.TeaData.

type TeaOfTheDay added in v1.3.0

type TeaOfTheDay struct {
	Tea  *QRRecord `json:"tea"`
	Date time.Time `json:"date"`
}

type Type

type Type string
const (
	TypeUnknown Type = "unknown"
	TypeTea     Type = "tea"
	TypeCoffee  Type = "coffee"
	TypeHerb    Type = "herb"
	TypeOther   Type = "other"
)

func FromBeverageType

func FromBeverageType(bt common.BeverageType) Type

FromBeverageType maps a common.BeverageType to the GraphQL Type.

func (Type) IsValid

func (e Type) IsValid() bool

func (Type) MarshalGQL

func (e Type) MarshalGQL(w io.Writer)

func (Type) MarshalJSON added in v1.3.0

func (e Type) MarshalJSON() ([]byte, error)

func (Type) String

func (e Type) String() string

func (Type) ToBeverageType

func (t Type) ToBeverageType() common.BeverageType

ToBeverageType maps GraphQL Type to a common.BeverageType.

func (*Type) UnmarshalGQL

func (e *Type) UnmarshalGQL(v any) error

func (*Type) UnmarshalJSON added in v1.3.0

func (e *Type) UnmarshalJSON(b []byte) error

type User

type User struct {
	TokenExpiredAt time.Time       `json:"tokenExpiredAt"`
	Collections    []*Collection   `json:"collections"`
	Notifications  []*Notification `json:"notifications"`
}

Jump to

Keyboard shortcuts

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