model

package
v0.0.0-...-0406d23 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientCollection     = "clients"
	InvitationCollection = "invitations"
	PermissionCollection = "permissions"
	RoleCollection       = "roles"
	KeyCollection        = "keys"
	UserCollection       = "users"
)

Variables

Functions

This section is empty.

Types

type Address

type Address struct {
	Street  *string `json:"street,omitempty"`
	City    *string `json:"city,omitempty"`
	State   *string `json:"state,omitempty"`
	Zip     *string `json:"zip,omitempty"`
	Country *string `json:"country,omitempty"`
}

type Balance

type Balance struct {
	Model   `bson:",inline"`
	UID     primitive.ObjectID `json:"uid" bson:"uid"`
	Type    string             `json:"type" bson:"type"`
	Credits int                `json:"credits" bson:"credits"`
	Notes   *string            `json:"notes,omitempty" bson:"notes,omitempty"`
	Status  string             `json:"status" bson:"status"`
}

func (*Balance) Collection

func (i *Balance) Collection() string

func (*Balance) Index

func (i *Balance) Index() []mongo.IndexModel

func (*Balance) MarshalBSON

func (i *Balance) MarshalBSON() ([]byte, error)

type Balances

type Balances struct {
	Count int        `json:"count"`
	Data  []*Balance `json:"data,omitempty"`
}

type Benefit

type Benefit struct {
	Model       `bson:",inline"`
	Locale      string      `json:"locale" bson:"locale"`
	Name        primitive.M `json:"name" bson:"name"`
	Description primitive.M `json:"description" bson:"description"`
	Status      string      `json:"status" bson:"status"`
}

func (*Benefit) Collection

func (i *Benefit) Collection() string

func (*Benefit) Index

func (i *Benefit) Index() []mongo.IndexModel

func (*Benefit) MarshalBSON

func (i *Benefit) MarshalBSON() ([]byte, error)

type Benefits

type Benefits struct {
	Data  []*Benefit `json:"data,omitempty"`
	Count int        `json:"count"`
}

type Companies

type Companies struct {
	Data  []*Company `json:"data,omitempty"`
	Count int        `json:"count"`
}

type Company

type Company struct {
	Model       `bson:",inline"`
	UID         primitive.ObjectID `json:"uid" bson:"uid"`
	Type        string             `json:"type" bson:"type"`
	Name        string             `json:"name" bson:"name"`
	Description *string            `json:"description,omitempty" bson:"description,omitempty"`
	Industry    *string            `json:"industry,omitempty" bson:"industry,omitempty"`
	Employees   *int               `json:"employees,omitempty" bson:"employees,omitempty"`
	Revenue     *float64           `json:"revenue,omitempty" bson:"revenue,omitempty"`
	Address     *Address           `json:"address,omitempty" bson:"address,omitempty"`
	Email       *string            `json:"email,omitempty" bson:"email,omitempty"`
	Phone       *string            `json:"phone,omitempty" bson:"phone,omitempty"`
	Website     *string            `json:"website,omitempty" bson:"website,omitempty"`
	Status      string             `json:"status" bson:"status"`
}

func (*Company) Collection

func (i *Company) Collection() string

func (*Company) Delete

func (i *Company) Delete(collection typesense.CollectionInterface, documentKey primitive.M) error

func (*Company) Document

func (i *Company) Document() map[string]interface{}

func (*Company) Index

func (i *Company) Index() []mongo.IndexModel

func (*Company) Insert

func (i *Company) Insert(collection typesense.CollectionInterface) error

func (Company) IsEntity

func (Company) IsEntity()

func (*Company) MarshalBSON

func (i *Company) MarshalBSON() ([]byte, error)

func (*Company) Sanitize

func (i *Company) Sanitize(s string) string

func (*Company) Schema

func (i *Company) Schema() interface{}

func (*Company) Update

func (i *Company) Update(collection typesense.CollectionInterface, documentKey primitive.M, updatedFields primitive.M, removedFields primitive.A) error

type Contact

type Contact struct {
	Model        `bson:",inline"`
	UID          primitive.ObjectID    `json:"uid" bson:"uid"`
	Company      *primitive.ObjectID   `json:"company,omitempty" bson:"company,omitempty"`
	FirstName    *string               `json:"first_name,omitempty" bson:"first_name,omitempty"`
	LastName     *string               `json:"last_name,omitempty" bson:"last_name,omitempty"`
	Birthday     primitive.DateTime    `json:"birthday,omitempty" bson:"birthday,omitempty"`
	Gender       *string               `json:"gender,omitempty" bson:"gender,omitempty"`
	JobTitle     *string               `json:"jobTitle,omitempty" bson:"job_title,omitempty"`
	Email        *string               `json:"email,omitempty" bson:"email,omitempty"`
	Phone        *string               `json:"phone,omitempty" bson:"phone,omitempty"`
	Picture      *string               `json:"picture,omitempty" bson:"picture,omitempty"`
	Address      *Address              `json:"address,omitempty" bson:"address,omitempty"`
	Website      *string               `json:"website,omitempty" bson:"website,omitempty"`
	Source       string                `json:"source,omitempty" bson:"source,omitempty"`
	Timezone     *string               `json:"timezone,omitempty" bson:"timezone,omitempty"`
	Language     *string               `json:"language,omitempty" bson:"language,omitempty"`
	Rating       *int                  `json:"rating,omitempty" bson:"rating,omitempty"`
	Subscribed   bool                  `json:"subscribed,omitempty" bson:"subscribed,omitempty"`
	Notes        *string               `json:"notes,omitempty" bson:"notes,omitempty"`
	Status       string                `json:"status" bson:"status"`
	LastActivity *primitive.Timestamp  `json:"last_activity,omitempty" bson:"last_activity,omitempty"`
	Labels       []*string             `json:"labels,omitempty" bson:"labels,omitempty"`
	Shares       []*primitive.ObjectID `json:"shares,omitempty" bson:"shares,omitempty"`
}

func (*Contact) Collection

func (i *Contact) Collection() string

func (*Contact) Delete

func (i *Contact) Delete(collection typesense.CollectionInterface, documentKey primitive.M) error

func (*Contact) Document

func (i *Contact) Document() map[string]interface{}

func (*Contact) Index

func (i *Contact) Index() []mongo.IndexModel

func (*Contact) Insert

func (i *Contact) Insert(collection typesense.CollectionInterface) error

func (Contact) IsEntity

func (Contact) IsEntity()

func (*Contact) MarshalBSON

func (i *Contact) MarshalBSON() ([]byte, error)

func (*Contact) Schema

func (i *Contact) Schema() interface{}

func (*Contact) Update

func (i *Contact) Update(collection typesense.CollectionInterface, documentKey primitive.M, updatedFields primitive.M, removedFields primitive.A) error

type ContactStage

type ContactStage string
const (
	ContactStageNew        ContactStage = "NEW"
	ContactStageNurturing  ContactStage = "NURTURING"
	ContactStageQualified  ContactStage = "QUALIFIED"
	ContactStageClosedLost ContactStage = "CLOSED_LOST"
	ContactStageClosedWon  ContactStage = "CLOSED_WON"
)

func (ContactStage) IsValid

func (e ContactStage) IsValid() bool

func (ContactStage) MarshalGQL

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

func (ContactStage) String

func (e ContactStage) String() string

func (*ContactStage) UnmarshalGQL

func (e *ContactStage) UnmarshalGQL(v interface{}) error

type ContactStatus

type ContactStatus string
const (
	ContactStatusActive   ContactStatus = "ACTIVE"
	ContactStatusInactive ContactStatus = "INACTIVE"
	ContactStatusArchived ContactStatus = "ARCHIVED"
)

func (ContactStatus) IsValid

func (e ContactStatus) IsValid() bool

func (ContactStatus) MarshalGQL

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

func (ContactStatus) String

func (e ContactStatus) String() string

func (*ContactStatus) UnmarshalGQL

func (e *ContactStatus) UnmarshalGQL(v interface{}) error

type Contacts

type Contacts struct {
	Count int        `json:"count"`
	Data  []*Contact `json:"data,omitempty"`
}

type Coupon

type Coupon struct {
	Model       `bson:",inline"`
	UID         *primitive.ObjectID   `json:"uid" bson:"uid"`
	Code        string                `json:"code" bson:"code"`
	Locale      string                `json:"locale" bson:"locale"`
	Name        primitive.M           `json:"name" bson:"name"`
	Description primitive.M           `json:"description" bson:"description"`
	Type        string                `json:"type" bson:"type"`
	Amount      float64               `json:"amount" bson:"amount"`
	MaxUses     *int                  `json:"max_uses,omitempty" bson:"max_uses,omitempty"`
	MaxDiscount *float64              `json:"max_discount,omitempty" bson:"max_discount,omitempty"`
	MinPurchase *float64              `json:"min_purchase,omitempty" bson:"min_purchase,omitempty"`
	Currency    string                `json:"currency" bson:"currency"`
	Uses        *int                  `json:"uses,omitempty" bson:"uses,omitempty"`
	Starts      *primitive.Timestamp  `json:"starts,omitempty" bson:"starts,omitempty"`
	Expires     *primitive.Timestamp  `json:"expires,omitempty" bson:"expires,omitempty"`
	Status      string                `json:"status" bson:"status"`
	Products    []*primitive.ObjectID `json:"products,omitempty" bson:"products,omitempty"`
}

func (*Coupon) Collection

func (i *Coupon) Collection() string

func (*Coupon) Index

func (i *Coupon) Index() []mongo.IndexModel

func (*Coupon) MarshalBSON

func (i *Coupon) MarshalBSON() ([]byte, error)

type Coupons

type Coupons struct {
	Data  []*Coupon `json:"data,omitempty"`
	Count int       `json:"count"`
}

type DiscountType

type DiscountType string
const (
	DiscountTypePercentage DiscountType = "PERCENTAGE"
	DiscountTypeFlatRate   DiscountType = "FLAT_RATE"
)

func (DiscountType) IsValid

func (e DiscountType) IsValid() bool

func (DiscountType) MarshalGQL

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

func (DiscountType) String

func (e DiscountType) String() string

func (*DiscountType) UnmarshalGQL

func (e *DiscountType) UnmarshalGQL(v interface{}) error

type EmailType

type EmailType string
const (
	EmailTypePersonal EmailType = "PERSONAL"
	EmailTypeWork     EmailType = "WORK"
	EmailTypeOther    EmailType = "OTHER"
)

func (EmailType) IsValid

func (e EmailType) IsValid() bool

func (EmailType) MarshalGQL

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

func (EmailType) String

func (e EmailType) String() string

func (*EmailType) UnmarshalGQL

func (e *EmailType) UnmarshalGQL(v interface{}) error

type Gender

type Gender string
const (
	GenderMale   Gender = "MALE"
	GenderFemale Gender = "FEMALE"
	GenderOther  Gender = "OTHER"
)

func (Gender) IsValid

func (e Gender) IsValid() bool

func (Gender) MarshalGQL

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

func (Gender) String

func (e Gender) String() string

func (*Gender) UnmarshalGQL

func (e *Gender) UnmarshalGQL(v interface{}) error

type Item

type Item struct {
	Model       `bson:",inline"`
	UID         primitive.ObjectID `bson:"uid" json:"uid"`
	Package     primitive.ObjectID `bson:"package" json:"package"`
	Locale      string             `json:"locale" bson:"locale"`
	Code        string             `json:"code" bson:"code"`
	Type        string             `json:"type" bson:"type"`
	Name        primitive.M        `json:"name" bson:"name"`
	Description primitive.M        `json:"description,omitempty" bson:"description,omitempty"`
	Start       primitive.DateTime `json:"start,omitempty" bson:"start,omitempty"`
	End         primitive.DateTime `json:"end,omitempty" bson:"end,omitempty"`
	Price       float64            `json:"price" bson:"price"`
	Discount    *float64           `json:"discount,omitempty" bson:"discount,omitempty"`
	Currency    string             `json:"currency" bson:"currency"`
}

func (*Item) Collection

func (i *Item) Collection() string

func (*Item) Index

func (i *Item) Index() []mongo.IndexModel

func (*Item) MarshalBSON

func (i *Item) MarshalBSON() ([]byte, error)

type Items

type Items struct {
	Items []*Item `json:"items,omitempty"`
	Count int     `json:"count"`
}

type Membership

type Membership struct {
	Model   `bson:",inline"`
	UID     primitive.ObjectID `json:"user" bson:"user"`
	Tier    primitive.ObjectID `json:"tier" bson:"tier"`
	Number  string             `json:"number" bson:"number"`
	Since   string             `json:"since" bson:"since"`
	Until   string             `json:"until" bson:"until"`
	Billing primitive.M        `json:"billing,omitempty" bson:"billing,omitempty"`
	Payment primitive.M        `json:"payment,omitempty" bson:"payment,omitempty"`
	Status  string             `json:"status" bson:"status"`
}

func (*Membership) Collection

func (i *Membership) Collection() string

func (*Membership) Index

func (i *Membership) Index() []mongo.IndexModel

func (Membership) IsEntity

func (Membership) IsEntity()

func (*Membership) MarshalBSON

func (i *Membership) MarshalBSON() ([]byte, error)

type Memberships

type Memberships struct {
	Data  []*Membership `json:"data,omitempty"`
	Count int           `json:"count"`
}

type Model

type Model struct {
	ID        primitive.ObjectID  `json:"id,omitempty" bson:"_id,omitempty"`
	Workspace primitive.ObjectID  `json:"workspace,omitempty" bson:"workspace,omitempty"`
	Metadata  primitive.M         `json:"metadata,omitempty" bson:"metadata,omitempty"`
	Created   primitive.Timestamp `json:"created,omitempty" bson:"created,omitempty"`
	Updated   primitive.Timestamp `json:"updated,omitempty" bson:"updated,omitempty"`
	Deleted   primitive.Timestamp `json:"deleted,omitempty" bson:"deleted,omitempty"`
	Timestamp primitive.Timestamp `json:"timestamp,omitempty" bson:"timestamp,omitempty"`
}

type NewBalance

type NewBalance struct {
	UID      string                 `json:"uid"`
	Type     string                 `json:"type"`
	Credits  int                    `json:"credits"`
	Notes    *string                `json:"notes,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	Status   string                 `json:"status"`
}

type NewBenefit

type NewBenefit struct {
	Locale      string                 `json:"locale"`
	Description string                 `json:"description"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type NewCompany

type NewCompany struct {
	UID         *string                `json:"uid,omitempty"`
	Name        string                 `json:"name"`
	Description *string                `json:"description,omitempty"`
	Type        string                 `json:"type"`
	Industry    *string                `json:"industry,omitempty"`
	Employees   *int                   `json:"employees,omitempty"`
	Revenue     *float64               `json:"revenue,omitempty"`
	Currency    *string                `json:"currency,omitempty"`
	Address     map[string]interface{} `json:"address,omitempty"`
	Email       *string                `json:"email,omitempty"`
	Phone       *string                `json:"phone,omitempty"`
	Website     *string                `json:"website,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      string                 `json:"status"`
}

type NewContact

type NewContact struct {
	FirstName    *string                `json:"first_name,omitempty"`
	LastName     *string                `json:"last_name,omitempty"`
	Email        *string                `json:"email,omitempty"`
	Phone        *string                `json:"phone,omitempty"`
	Picture      *string                `json:"picture,omitempty"`
	Address      map[string]interface{} `json:"address,omitempty"`
	Birthday     *string                `json:"birthday,omitempty"`
	Company      *string                `json:"company,omitempty"`
	JobTitle     *string                `json:"job_title,omitempty"`
	Timezone     *string                `json:"timezone,omitempty"`
	Language     *string                `json:"language,omitempty"`
	Source       *string                `json:"source,omitempty"`
	Subscribed   *bool                  `json:"subscribed,omitempty"`
	Rating       *int                   `json:"rating,omitempty"`
	Notes        *string                `json:"notes,omitempty"`
	Status       *string                `json:"status,omitempty"`
	Labels       []*string              `json:"labels,omitempty"`
	Metadata     map[string]interface{} `json:"metadata,omitempty"`
	LastActivity *string                `json:"last_activity,omitempty"`
	Created      string                 `json:"created"`
	Updated      string                 `json:"updated"`
	UID          *string                `json:"uid,omitempty"`
}

type NewCoupon

type NewCoupon struct {
	Locale      string                 `json:"locale"`
	Code        string                 `json:"code"`
	Name        string                 `json:"name"`
	Description *string                `json:"description,omitempty"`
	Type        string                 `json:"type"`
	Amount      float64                `json:"amount"`
	MaxDiscount *float64               `json:"max_discount,omitempty"`
	MinPurchase *float64               `json:"min_purchase,omitempty"`
	Currency    string                 `json:"currency"`
	MaxUses     *int                   `json:"max_uses,omitempty"`
	Uses        *int                   `json:"uses,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Starts      *string                `json:"starts,omitempty"`
	Expires     *string                `json:"expires,omitempty"`
	UID         *string                `json:"uid,omitempty"`
	Products    []*string              `json:"products,omitempty"`
	Status      *string                `json:"status,omitempty"`
}

type NewItem

type NewItem struct {
	Package     string                 `json:"package"`
	Locale      string                 `json:"locale"`
	Type        string                 `json:"type"`
	Code        string                 `json:"code"`
	Name        string                 `json:"name"`
	Description *string                `json:"description,omitempty"`
	Quantity    int                    `json:"quantity"`
	Price       float64                `json:"price"`
	Discount    *float64               `json:"discount,omitempty"`
	Currency    string                 `json:"currency"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      *string                `json:"status,omitempty"`
}

type NewMembership

type NewMembership struct {
	Tier     string                 `json:"tier"`
	Number   string                 `json:"number"`
	Since    string                 `json:"since"`
	Until    string                 `json:"until"`
	Billing  map[string]interface{} `json:"billing,omitempty"`
	Payment  map[string]interface{} `json:"payment,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	Status   string                 `json:"status"`
}

type NewOrder

type NewOrder struct {
	Code        string                 `json:"code"`
	Cancellable bool                   `json:"cancellable"`
	Payment     string                 `json:"payment"`
	Coupon      *string                `json:"coupon,omitempty"`
	UID         *string                `json:"uid,omitempty"`
	Contact     *string                `json:"contact,omitempty"`
	Items       []string               `json:"items"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      *string                `json:"status,omitempty"`
	Shares      []*string              `json:"shares,omitempty"`
}

type NewPackage

type NewPackage struct {
	Locale       string                 `json:"locale"`
	Name         string                 `json:"name"`
	Description  string                 `json:"description"`
	Includes     string                 `json:"includes"`
	Excludes     string                 `json:"excludes"`
	Redeem       string                 `json:"redeem"`
	Cancellation string                 `json:"cancellation"`
	Instant      bool                   `json:"instant"`
	Metadata     map[string]interface{} `json:"metadata,omitempty"`
	Status       string                 `json:"status"`
	Product      string                 `json:"product"`
}

type NewProduct

type NewProduct struct {
	UID         *string                `json:"uid,omitempty"`
	Locale      string                 `json:"locale"`
	Type        string                 `json:"type"`
	Slug        string                 `json:"slug"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Duration    string                 `json:"duration"`
	Reviewable  bool                   `json:"reviewable"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      string                 `json:"status"`
	Terms       []*string              `json:"terms,omitempty"`
	Place       *string                `json:"place,omitempty"`
	Places      []*string              `json:"places,omitempty"`
}

type NewPromotion

type NewPromotion struct {
	Type        string                 `json:"type"`
	Locale      string                 `json:"locale"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Credits     int                    `json:"credits"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type NewQuote

type NewQuote struct {
	UID         string                 `json:"uid"`
	Contact     *string                `json:"contact,omitempty"`
	Locale      string                 `json:"locale"`
	Code        string                 `json:"code"`
	Purchase    string                 `json:"purchase"`
	Name        string                 `json:"name"`
	Description *string                `json:"description,omitempty"`
	Terms       *string                `json:"terms,omitempty"`
	Notes       *string                `json:"notes,omitempty"`
	Template    string                 `json:"template"`
	ValidUntil  int                    `json:"validUntil"`
	Amount      float64                `json:"amount"`
	Currency    string                 `json:"currency"`
	Billing     map[string]interface{} `json:"billing"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      *string                `json:"status,omitempty"`
	Shares      []*string              `json:"shares,omitempty"`
}

type NewReward

type NewReward struct {
	Locale      string                 `json:"locale"`
	Tier        string                 `json:"tier"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Cost        int                    `json:"cost"`
	Expires     *string                `json:"expires,omitempty"`
	Status      string                 `json:"status"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type NewTier

type NewTier struct {
	Locale      string                 `json:"locale"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Cost        int                    `json:"cost"`
	Rewards     []string               `json:"rewards"`
	Status      string                 `json:"status"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type NewVoucher

type NewVoucher struct {
	Locale      string                 `json:"locale"`
	Code        string                 `json:"code"`
	Type        string                 `json:"type"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Start       string                 `json:"start"`
	End         string                 `json:"end"`
	Price       float64                `json:"price"`
	Discount    *float64               `json:"discount,omitempty"`
	Currency    string                 `json:"currency"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      string                 `json:"status"`
	Package     string                 `json:"package"`
	Supplier    string                 `json:"supplier"`
}

type NewWishlist

type NewWishlist struct {
	Content  string                 `json:"content"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type Order

type Order struct {
	Model       `bson:",inline"`
	UID         primitive.ObjectID    `bson:"uid" json:"uid"`
	Contact     primitive.ObjectID    `json:"contact" bson:"contact"`
	Locale      string                `json:"locale" bson:"locale"`
	Type        string                `json:"type" bson:"type"`
	Code        string                `json:"code" bson:"code"`
	Coupon      *string               `json:"coupon,omitempty" bson:"coupon,omitempty"`
	Cancellable bool                  `json:"cancellable" bson:"cancellable"`
	Payment     string                `json:"payment" bson:"payment"`
	Items       []primitive.ObjectID  `json:"items" bson:"items"`
	Status      string                `json:"status" bson:"status"`
	Shares      []*primitive.ObjectID `json:"shares,omitempty" bson:"shares,omitempty"`
}

func (*Order) Collection

func (i *Order) Collection() string

func (*Order) Index

func (i *Order) Index() []mongo.IndexModel

func (*Order) MarshalBSON

func (i *Order) MarshalBSON() ([]byte, error)

type Orders

type Orders struct {
	Data  []*Order `json:"data,omitempty"`
	Count int      `json:"count"`
}

type Package

type Package struct {
	Model        `bson:",inline"`
	Product      primitive.ObjectID `json:"product" bson:"product"`
	Locale       string             `json:"locale" bson:"locale"`
	Name         primitive.M        `json:"name" bson:"name"`
	Description  primitive.M        `json:"description" bson:"description"`
	Includes     primitive.M        `json:"includes" bson:"includes"`
	Excludes     primitive.M        `json:"excludes" bson:"excludes"`
	Redeem       primitive.M        `json:"redeem" bson:"redeem"`
	Cancellation primitive.M        `json:"cancellation" bson:"cancellation"`
	Instant      bool               `json:"instant" bson:"instant"`
	Price        float64            `json:"price" bson:"price"`
	Discount     float64            `json:"discount,omitempty" bson:"discount,omitempty"`
	Currency     string             `json:"currency" bson:"currency"`
	Status       string             `json:"status" bson:"status"`
}

func (*Package) Collection

func (i *Package) Collection() string

func (*Package) Index

func (i *Package) Index() []mongo.IndexModel

func (*Package) MarshalBSON

func (i *Package) MarshalBSON() ([]byte, error)

type Packages

type Packages struct {
	Total int        `json:"total"`
	Data  []*Package `json:"data,omitempty"`
}

type PhoneType

type PhoneType string
const (
	PhoneTypeHome   PhoneType = "HOME"
	PhoneTypeMobile PhoneType = "MOBILE"
	PhoneTypeWork   PhoneType = "WORK"
	PhoneTypeOther  PhoneType = "OTHER"
)

func (PhoneType) IsValid

func (e PhoneType) IsValid() bool

func (PhoneType) MarshalGQL

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

func (PhoneType) String

func (e PhoneType) String() string

func (*PhoneType) UnmarshalGQL

func (e *PhoneType) UnmarshalGQL(v interface{}) error

type Product

type Product struct {
	Model           `bson:",inline"`
	UID             primitive.ObjectID    `json:"uid" bson:"uid"`
	Place           primitive.ObjectID    `json:"place" bson:"place"`
	Locale          string                `json:"locale" bson:"locale"`
	Slug            string                `json:"slug" bson:"slug"`
	Type            string                `json:"type" bson:"type"`
	Name            primitive.M           `json:"name" bson:"name"`
	Description     primitive.M           `json:"description" bson:"description"`
	Duration        string                `json:"duration" bson:"duration"`
	Reviewable      bool                  `json:"reviewable" bson:"reviewable"`
	Status          string                `json:"status" bson:"status"`
	Terms           []*primitive.ObjectID `json:"terms,omitempty" bson:"terms,omitempty"`
	Places          []*primitive.ObjectID `json:"places,omitempty" bson:"places,omitempty"`
	Recommendations []*string             `json:"recommendations,omitempty" bson:"recommendations,omitempty"`
}

func (*Product) Collection

func (i *Product) Collection() string

func (*Product) Delete

func (i *Product) Delete(collection typesense.CollectionInterface, documentKey primitive.M) error

func (*Product) Document

func (i *Product) Document() map[string]interface{}

func (*Product) Index

func (i *Product) Index() []mongo.IndexModel

func (*Product) Insert

func (i *Product) Insert(collection typesense.CollectionInterface) error

func (Product) IsEntity

func (Product) IsEntity()

func (*Product) MarshalBSON

func (i *Product) MarshalBSON() ([]byte, error)

func (*Product) Schema

func (i *Product) Schema() interface{}

func (*Product) Update

func (i *Product) Update(collection typesense.CollectionInterface, documentKey primitive.M, updatedFields primitive.M, removedFields primitive.A) error

type ProductStatus

type ProductStatus string
const (
	ProductStatusActive   ProductStatus = "ACTIVE"
	ProductStatusInactive ProductStatus = "INACTIVE"
	ProductStatusPending  ProductStatus = "PENDING"
	ProductStatusArchived ProductStatus = "ARCHIVED"
)

func (ProductStatus) IsValid

func (e ProductStatus) IsValid() bool

func (ProductStatus) MarshalGQL

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

func (ProductStatus) String

func (e ProductStatus) String() string

func (*ProductStatus) UnmarshalGQL

func (e *ProductStatus) UnmarshalGQL(v interface{}) error

type Products

type Products struct {
	Count int        `json:"count"`
	Data  []*Product `json:"data,omitempty"`
}

type Promotion

type Promotion struct {
	Model       `bson:",inline"`
	Type        string      `bson:"type,optional" json:"type,omitempty"`
	Locale      string      `bson:"locale,omitempty" json:"locale,omitempty"`
	Name        primitive.M `json:"name,omitempty" bson:"name,omitempty"`
	Description primitive.M `bson:"description,omitempty" json:"description,omitempty"`
	Credits     int         `json:"credits,omitempty" bson:"credits,omitempty"`
	Status      string      `json:"status,omitempty" bson:"status,omitempty"`
}

func (*Promotion) Collection

func (i *Promotion) Collection() string

func (*Promotion) Index

func (i *Promotion) Index() []mongo.IndexModel

func (*Promotion) MarshalBSON

func (i *Promotion) MarshalBSON() ([]byte, error)

type PromotionType

type PromotionType string
const (
	PromotionTypePurchase     PromotionType = "PURCHASE"
	PromotionTypeReferral     PromotionType = "REFERRAL"
	PromotionTypeSignup       PromotionType = "SIGNUP"
	PromotionTypeReview       PromotionType = "REVIEW"
	PromotionTypeBirthday     PromotionType = "BIRTHDAY"
	PromotionTypeSubscription PromotionType = "SUBSCRIPTION"
)

func (PromotionType) IsValid

func (e PromotionType) IsValid() bool

func (PromotionType) MarshalGQL

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

func (PromotionType) String

func (e PromotionType) String() string

func (*PromotionType) UnmarshalGQL

func (e *PromotionType) UnmarshalGQL(v interface{}) error

type Promotions

type Promotions struct {
	Data  []*Promotion `json:"data,omitempty"`
	Count int          `json:"count"`
}

type Quote

type Quote struct {
	Model
	UID         primitive.ObjectID    `json:"uid" bson:"uid"`
	Contact     primitive.ObjectID    `json:"contacts" bson:"contacts"`
	Code        string                `json:"code" bson:"code"`
	Purchase    *string               `json:"purchase,omitempty" bson:"purchase,omitempty"`
	Locale      string                `json:"locale" bson:"locale"`
	Name        string                `json:"name" bson:"name"`
	Description *string               `json:"description,omitempty" bson:"description,omitempty"`
	Template    string                `json:"template" bson:"template"`
	ValidUntil  primitive.Timestamp   `json:"validUntil" bson:"valid_until"`
	Terms       string                `json:"terms" bson:"terms"`
	Payment     string                `json:"payment" bson:"payment"`
	Notes       string                `json:"notes,omitempty" bson:"notes,omitempty"`
	Billing     primitive.M           `json:"billing,omitempty" bson:"billing,omitempty"`
	Status      string                `json:"status" bson:"status"`
	Shares      []*primitive.ObjectID `json:"shares,omitempty" bson:"shares,omitempty"`
}

func (*Quote) Collection

func (i *Quote) Collection() string

func (*Quote) Index

func (i *Quote) Index() []mongo.IndexModel

func (*Quote) MarshalBSON

func (i *Quote) MarshalBSON() ([]byte, error)

type Quotes

type Quotes struct {
	Count int      `json:"count"`
	Data  []*Quote `json:"data,omitempty"`
}

type Reward

type Reward struct {
	Model       `bson:",inline"`
	Tier        primitive.ObjectID   `bson:"tier" json:"tier"`
	Locale      string               `bson:"locale" json:"locale"`
	Name        primitive.M          `json:"name" bson:"name"`
	Description primitive.M          `json:"description,omitempty" bson:"description,omitempty"`
	Cost        int64                `json:"cost" bson:"cost"`
	Expires     *primitive.Timestamp `json:"expires,omitempty" bson:"expires,omitempty"`
	Status      string               `json:"status" bson:"status"`
}

func (*Reward) Collection

func (i *Reward) Collection() string

func (*Reward) Index

func (i *Reward) Index() []mongo.IndexModel

func (*Reward) MarshalBSON

func (i *Reward) MarshalBSON() ([]byte, error)

type Rewards

type Rewards struct {
	Data  []*Reward `json:"data,omitempty"`
	Count int       `json:"count"`
}

type Tier

type Tier struct {
	Model       `bson:",inline"`
	Locale      string               `bson:"locale,omitempty" json:"locale,omitempty"`
	Name        primitive.M          `json:"name,omitempty" bson:"name,omitempty"`
	Description primitive.M          `json:"description,omitempty" bson:"description,omitempty"`
	Benefits    []primitive.ObjectID `json:"benefits,omitempty" bson:"benefits,omitempty"`
	Cost        int64                `json:"cost,omitempty" bson:"cost,omitempty"`
	Status      string               `json:"status,omitempty" bson:"status,omitempty"`
}

func (*Tier) Collection

func (i *Tier) Collection() string

func (*Tier) Index

func (i *Tier) Index() []mongo.IndexModel

func (*Tier) MarshalBSON

func (i *Tier) MarshalBSON() ([]byte, error)

type Tiers

type Tiers struct {
	Data  []*Tier `json:"data,omitempty"`
	Count int     `json:"count"`
}

type UpdateBalance

type UpdateBalance struct {
	Type     *string                `json:"type,omitempty"`
	Credits  *int                   `json:"credits,omitempty"`
	Notes    *string                `json:"notes,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	Status   *string                `json:"status,omitempty"`
}

type UpdateBenefit

type UpdateBenefit struct {
	Locale      *string                `json:"locale,omitempty"`
	Description *string                `json:"description,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type UpdateCompany

type UpdateCompany struct {
	UID         *string                `json:"uid,omitempty"`
	Name        *string                `json:"name,omitempty"`
	Description *string                `json:"description,omitempty"`
	Type        *string                `json:"type,omitempty"`
	Industry    *string                `json:"industry,omitempty"`
	Employees   *int                   `json:"employees,omitempty"`
	Revenue     *float64               `json:"revenue,omitempty"`
	Address     map[string]interface{} `json:"address,omitempty"`
	Email       *string                `json:"email,omitempty"`
	Phone       *string                `json:"phone,omitempty"`
	Website     *string                `json:"website,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      *string                `json:"status,omitempty"`
}

type UpdateContact

type UpdateContact struct {
	FirstName    *string                `json:"first_name,omitempty"`
	LastName     *string                `json:"last_name,omitempty"`
	Email        *string                `json:"email,omitempty"`
	Phone        *string                `json:"phone,omitempty"`
	Picture      *string                `json:"picture,omitempty"`
	Address      map[string]interface{} `json:"address,omitempty"`
	Birthday     *string                `json:"birthday,omitempty"`
	Company      *string                `json:"company,omitempty"`
	JobTitle     *string                `json:"job_title,omitempty"`
	Timezone     *string                `json:"timezone,omitempty"`
	Language     *string                `json:"language,omitempty"`
	Source       *string                `json:"source,omitempty"`
	Subscribed   *bool                  `json:"subscribed,omitempty"`
	Rating       *int                   `json:"rating,omitempty"`
	Notes        *string                `json:"notes,omitempty"`
	Status       *string                `json:"status,omitempty"`
	Labels       []*string              `json:"labels,omitempty"`
	Metadata     map[string]interface{} `json:"metadata,omitempty"`
	LastActivity *string                `json:"last_activity,omitempty"`
	Created      string                 `json:"created"`
	Updated      string                 `json:"updated"`
	UID          string                 `json:"uid"`
}

type UpdateCoupon

type UpdateCoupon struct {
	Locale      *string                `json:"locale,omitempty"`
	Code        *string                `json:"code,omitempty"`
	Name        *string                `json:"name,omitempty"`
	Description *string                `json:"description,omitempty"`
	Type        *string                `json:"type,omitempty"`
	Amount      *float64               `json:"amount,omitempty"`
	MaxDiscount *float64               `json:"max_discount,omitempty"`
	MinPurchase *float64               `json:"min_purchase,omitempty"`
	Currency    *string                `json:"currency,omitempty"`
	MaxUses     *int                   `json:"max_uses,omitempty"`
	Uses        *int                   `json:"uses,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Starts      *string                `json:"starts,omitempty"`
	Expires     *string                `json:"expires,omitempty"`
	UID         *string                `json:"uid,omitempty"`
	Products    []*string              `json:"products,omitempty"`
	Status      *string                `json:"status,omitempty"`
}

type UpdateItem

type UpdateItem struct {
	Package     *string                `json:"package,omitempty"`
	Locale      *string                `json:"locale,omitempty"`
	Type        *string                `json:"type,omitempty"`
	Code        *string                `json:"code,omitempty"`
	Name        *string                `json:"name,omitempty"`
	Description *string                `json:"description,omitempty"`
	Quantity    *int                   `json:"quantity,omitempty"`
	Price       *float64               `json:"price,omitempty"`
	Discount    *float64               `json:"discount,omitempty"`
	Currency    *string                `json:"currency,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      *string                `json:"status,omitempty"`
}

type UpdateMembership

type UpdateMembership struct {
	Tier     *string                `json:"tier,omitempty"`
	Number   *string                `json:"number,omitempty"`
	Since    *string                `json:"since,omitempty"`
	Until    *string                `json:"until,omitempty"`
	Billing  map[string]interface{} `json:"billing,omitempty"`
	Payment  map[string]interface{} `json:"payment,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	Status   *string                `json:"status,omitempty"`
}

type UpdateOrder

type UpdateOrder struct {
	Code        *string                `json:"code,omitempty"`
	Cancellable *bool                  `json:"cancellable,omitempty"`
	Payment     *string                `json:"payment,omitempty"`
	Coupon      *string                `json:"coupon,omitempty"`
	UID         *string                `json:"uid,omitempty"`
	Contact     *string                `json:"contact,omitempty"`
	Items       []string               `json:"items,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      *string                `json:"status,omitempty"`
	Shares      []*string              `json:"shares,omitempty"`
}

type UpdatePackage

type UpdatePackage struct {
	Locale       *string                `json:"locale,omitempty"`
	Name         *string                `json:"name,omitempty"`
	Description  *string                `json:"description,omitempty"`
	Includes     *string                `json:"includes,omitempty"`
	Excludes     *string                `json:"excludes,omitempty"`
	Redeem       *string                `json:"redeem,omitempty"`
	Cancellation *string                `json:"cancellation,omitempty"`
	Instant      *bool                  `json:"instant,omitempty"`
	Metadata     map[string]interface{} `json:"metadata,omitempty"`
	Status       *string                `json:"status,omitempty"`
	Product      *string                `json:"product,omitempty"`
}

type UpdateProduct

type UpdateProduct struct {
	Locale      *string                `json:"locale,omitempty"`
	Type        *string                `json:"type,omitempty"`
	Slug        *string                `json:"slug,omitempty"`
	Name        *string                `json:"name,omitempty"`
	Description *string                `json:"description,omitempty"`
	Duration    *string                `json:"duration,omitempty"`
	Reviewable  *bool                  `json:"reviewable,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      *string                `json:"status,omitempty"`
	Terms       []*string              `json:"terms,omitempty"`
	Place       *string                `json:"place,omitempty"`
	Places      []*string              `json:"places,omitempty"`
}

type UpdatePromotion

type UpdatePromotion struct {
	Locale      *string                `json:"locale,omitempty"`
	Name        *string                `json:"name,omitempty"`
	Description *string                `json:"description,omitempty"`
	Credits     *int                   `json:"credits,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type UpdateQuote

type UpdateQuote struct {
	UID         *string                `json:"uid,omitempty"`
	Contact     *string                `json:"contact,omitempty"`
	Locale      *string                `json:"locale,omitempty"`
	Code        *string                `json:"code,omitempty"`
	Purchase    *string                `json:"purchase,omitempty"`
	Name        *string                `json:"name,omitempty"`
	Description *string                `json:"description,omitempty"`
	Terms       *string                `json:"terms,omitempty"`
	Notes       *string                `json:"notes,omitempty"`
	Template    *string                `json:"template,omitempty"`
	ValidUntil  *int                   `json:"validUntil,omitempty"`
	Amount      *float64               `json:"amount,omitempty"`
	Currency    *string                `json:"currency,omitempty"`
	Billing     map[string]interface{} `json:"billing,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      *string                `json:"status,omitempty"`
	Shares      []*string              `json:"shares,omitempty"`
}

type UpdateReward

type UpdateReward struct {
	Locale      string                 `json:"locale"`
	Tier        *string                `json:"tier,omitempty"`
	Cost        *string                `json:"cost,omitempty"`
	Name        *string                `json:"name,omitempty"`
	Description *string                `json:"description,omitempty"`
	Credits     *int                   `json:"credits,omitempty"`
	Expires     *string                `json:"expires,omitempty"`
	Status      *string                `json:"status,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type UpdateTier

type UpdateTier struct {
	Locale      string                 `json:"locale"`
	Name        *string                `json:"name,omitempty"`
	Description *string                `json:"description,omitempty"`
	Cost        *int                   `json:"cost,omitempty"`
	Rewards     []string               `json:"rewards,omitempty"`
	Status      *string                `json:"status,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type UpdateVoucher

type UpdateVoucher struct {
	Locale      *string                `json:"locale,omitempty"`
	Code        *string                `json:"code,omitempty"`
	Type        *string                `json:"type,omitempty"`
	Name        *string                `json:"name,omitempty"`
	Description *string                `json:"description,omitempty"`
	Start       *string                `json:"start,omitempty"`
	End         string                 `json:"end"`
	Price       *float64               `json:"price,omitempty"`
	Discount    *float64               `json:"discount,omitempty"`
	Currency    *string                `json:"currency,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      *string                `json:"status,omitempty"`
	Package     *string                `json:"package,omitempty"`
	Supplier    *string                `json:"supplier,omitempty"`
}

type UpdateWishlist

type UpdateWishlist struct {
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	Status   *string                `json:"status,omitempty"`
}

type User

type User struct {
	ID string `json:"id" bson:"_id"`
}

func (User) IsEntity

func (User) IsEntity()

type Voucher

type Voucher struct {
	Model       `bson:",inline"`
	Locale      string             `json:"locale" bson:"locale"`
	Code        string             `json:"code" bson:"code"`
	Type        string             `json:"type" bson:"type"`
	Name        primitive.M        `json:"name" bson:"name"`
	Description primitive.M        `json:"description,omitempty" bson:"description,omitempty"`
	Start       primitive.DateTime `json:"start,omitempty" bson:"start,omitempty"`
	End         primitive.DateTime `json:"end,omitempty" bson:"end,omitempty"`
	Price       float64            `json:"price" bson:"price"`
	Discount    float64            `json:"discount,omitempty" bson:"discount,omitempty"`
	Currency    string             `json:"currency" bson:"currency"`
	Status      string             `json:"status" bson:"status"`
	Package     primitive.ObjectID `json:"package" bson:"package"`
	Supplier    primitive.ObjectID `json:"supplier" bson:"supplier"`
}

func (*Voucher) Collection

func (i *Voucher) Collection() string

func (*Voucher) Index

func (i *Voucher) Index() []mongo.IndexModel

func (*Voucher) MarshalBSON

func (i *Voucher) MarshalBSON() ([]byte, error)

type Vouchers

type Vouchers struct {
	Count int        `json:"count"`
	Data  []*Voucher `json:"data,omitempty"`
}

type Wishlist

type Wishlist struct {
	Model   `bson:",inline"`
	UID     primitive.ObjectID `json:"uid" bson:"uid"`
	Content primitive.ObjectID `json:"content" bson:"content"`
	Status  string             `json:"status" bson:"status"`
}

func (*Wishlist) Collection

func (i *Wishlist) Collection() string

func (*Wishlist) Index

func (i *Wishlist) Index() []mongo.IndexModel

func (*Wishlist) MarshalBSON

func (i *Wishlist) MarshalBSON() ([]byte, error)

type WishlistStatus

type WishlistStatus string
const (
	WishlistStatusActive   WishlistStatus = "ACTIVE"
	WishlistStatusArchived WishlistStatus = "ARCHIVED"
	WishlistStatusDeleted  WishlistStatus = "DELETED"
)

func (WishlistStatus) IsValid

func (e WishlistStatus) IsValid() bool

func (WishlistStatus) MarshalGQL

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

func (WishlistStatus) String

func (e WishlistStatus) String() string

func (*WishlistStatus) UnmarshalGQL

func (e *WishlistStatus) UnmarshalGQL(v interface{}) error

type Wishlists

type Wishlists struct {
	Count int         `json:"count"`
	Data  []*Wishlist `json:"data"`
}

Jump to

Keyboard shortcuts

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