Documentation ¶
Index ¶
- Constants
- func CollectionAllergens(ctx context.Context) (*mongo.Collection, error)
- func CollectionCarts(ctx context.Context) (*mongo.Collection, error)
- func CollectionCoupons(ctx context.Context) (*mongo.Collection, error)
- func CollectionOrders(ctx context.Context) (*mongo.Collection, error)
- func CollectionProductCategories(ctx context.Context) (*mongo.Collection, error)
- func CollectionProductOptions(ctx context.Context) (*mongo.Collection, error)
- func CollectionProducts(ctx context.Context) (*mongo.Collection, error)
- func CollectionStores(ctx context.Context) (*mongo.Collection, error)
- func CollectionTaxes(ctx context.Context) (*mongo.Collection, error)
- func CollectionUsers(ctx context.Context) (*mongo.Collection, error)
- type Allergen
- type Cart
- type CartCheckout
- type CartItem
- type Coupon
- type CouponUsage
- type CustomizablePrice
- type DeliverectIntegration
- type Image
- type Order
- type OrderItem
- type OrderSummary
- type Payment
- type Product
- type ProductCategory
- type ProductOption
- type ProductOptionValue
- type ProductVariation
- type ProductVariationOption
- type RefundRequest
- type RoleEntry
- type Store
- type Tax
- type TotalSummary
- type User
Constants ¶
View Source
const ( CouponTypeGiftCard = "GiftCard" // This can be generated GS or old bought GS, a.k.a. Einzweck-Gutscheine CouponTypeMehrzweck = "Mehrzweck" // This can be the new bought GS, a.k.a. Mehrzweck-Gutscheine )
View Source
const ( TaxClassStandard = "standard" TaxClassTakeaway = "takeaway" TaxClassZero = "kein" )
View Source
const ( RoleAdmin = "Admin" RoleStoreAdmin = "Store Admin" RoleStoreStandard = "Store Standard" )
View Source
const CouponSKU = "_CP"
View Source
const TipSKU = "_TIP"
Variables ¶
This section is empty.
Functions ¶
func CollectionAllergens ¶
func CollectionAllergens(ctx context.Context) (*mongo.Collection, error)
func CollectionCarts ¶
func CollectionCarts(ctx context.Context) (*mongo.Collection, error)
func CollectionCoupons ¶
func CollectionCoupons(ctx context.Context) (*mongo.Collection, error)
func CollectionOrders ¶
func CollectionOrders(ctx context.Context) (*mongo.Collection, error)
func CollectionProductCategories ¶
func CollectionProductCategories(ctx context.Context) (*mongo.Collection, error)
func CollectionProductOptions ¶
func CollectionProductOptions(ctx context.Context) (*mongo.Collection, error)
func CollectionProducts ¶
func CollectionProducts(ctx context.Context) (*mongo.Collection, error)
func CollectionStores ¶
func CollectionStores(ctx context.Context) (*mongo.Collection, error)
func CollectionTaxes ¶
func CollectionTaxes(ctx context.Context) (*mongo.Collection, error)
func CollectionUsers ¶
func CollectionUsers(ctx context.Context) (*mongo.Collection, error)
Types ¶
type Cart ¶
type Cart struct { ID primitive.ObjectID `bson:"_id" json:"id"` User *string `bson:"user,omitempty" json:"user,omitempty"` StoreKey string `bson:"storeKey" json:"storeKey"` IsPickup bool `bson:"isPickup" json:"isPickup"` Items []CartItem `bson:"items" json:"items"` CouponCode *string `bson:"couponCode,omitempty" json:"couponCode,omitempty"` Tip *string `bson:"tip,omitempty" json:"tip,omitempty"` Secret string `bson:"secret" json:"secret"` Payments []Payment `bson:"payments" json:"payments"` Paid bool `bson:"paid" json:"paid"` Checkout *CartCheckout `bson:"checkout,omitempty" json:"checkout,omitempty"` CreatedAt time.Time `bson:"createdAt" json:"createdAt"` UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"` }
type CartCheckout ¶
type CartCheckout struct { FirstName string `bson:"firstName" json:"firstName"` LastName string `bson:"lastName" json:"lastName"` AddressLine1 string `bson:"addressLine1" json:"addressLine1"` AddressLine2 string `bson:"addressLine2" json:"addressLine2"` City string `bson:"city" json:"city"` Postcode string `bson:"postcode" json:"postcode"` Telephone string `bson:"telephone" json:"telephone"` Email string `bson:"email" json:"email"` Note string `bson:"note" json:"note"` Date string `bson:"date" json:"date"` Slot string `bson:"slot" json:"slot"` Begin *time.Time `bson:"begin,omitempty" json:"begin,omitempty"` }
type Coupon ¶
type Coupon struct { ID primitive.ObjectID `bson:"_id" json:"id"` Type string `bson:"type" json:"type"` Code string `bson:"code" json:"code"` Total string `bson:"total" json:"total"` Usage []CouponUsage `bson:"usage" json:"usage"` Disabled bool `bson:"disabled" json:"disabled"` CreatedAt time.Time `bson:"createdAt" json:"createdAt"` UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"` }
func NewMehrzweckCoupon ¶
type CouponUsage ¶
type CouponUsage struct { OrderID string `bson:"orderId" json:"orderId"` Total string `bson:"total" json:"total"` CreatedAt time.Time `bson:"createdAt" json:"createdAt"` Net *string `bson:"net,omitempty" json:"net,omitempty"` Tax *string `bson:"tax,omitempty" json:"tax,omitempty"` TaxClass *string `bson:"taxClass,omitempty" json:"taxClass,omitempty"` }
type CustomizablePrice ¶
type CustomizablePrice struct { Value string `bson:"value" json:"value"` CustomValues map[string]string `bson:"customValues" json:"customValues"` }
func (*CustomizablePrice) GetPrice ¶
func (p *CustomizablePrice) GetPrice(key string) string
type DeliverectIntegration ¶
type Order ¶
type Order struct { ID primitive.ObjectID `bson:"_id" json:"id"` StoreKey string `bson:"storeKey" json:"storeKey"` User *string `bson:"user,omitempty" json:"user,omitempty"` CouponCode *string `bson:"couponCode,omitempty" json:"couponCode,omitempty"` Tip *string `bson:"tip,omitempty" json:"tip,omitempty"` IsPickup bool `bson:"isPickup" json:"isPickup"` Items []OrderItem `bson:"items" json:"items"` Summary OrderSummary `bson:"summary" json:"summary"` Secret string `bson:"secret" json:"secret"` Paid bool `bson:"paid" json:"paid"` InvoiceNumber *string `bson:"invoiceNumber,omitempty" json:"invoiceNumber,omitempty"` OrderNumber *string `bson:"orderNumber,omitempty" json:"orderNumber,omitempty"` Payment *Payment `bson:"payment,omitempty" json:"payment,omitempty"` Checkout *CartCheckout `bson:"checkout,omitempty" json:"checkout,omitempty"` Refunds []checkout.PaymentRefundResponse `bson:"refunds" json:"refunds"` RefundRequests []RefundRequest `bson:"refundRequests" json:"refundRequests"` Source *string `bson:"source,omitempty" json:"source,omitempty"` CreatedAt time.Time `bson:"createdAt" json:"createdAt"` UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"` }
func (Order) GetPaidEvent ¶
func (o Order) GetPaidEvent() webhook.NotificationRequestItem
type OrderItem ¶
type OrderItem struct { CartItem SKU string `bson:"sku" json:"sku"` Name string `bson:"name" json:"name"` Categories []string `bson:"categories" json:"categories"` UnitPrice string `bson:"unitPrice" json:"unitPrice"` Total string `bson:"total" json:"total"` Tax string `bson:"tax" json:"tax"` Net string `bson:"net" json:"net"` Saving string `bson:"saving" json:"saving"` TaxClass string `bson:"taxClass" json:"taxClass"` IsGiftCard bool `bson:"isGiftCard" json:"isGiftCard"` GiftCardCode []string `bson:"giftCardCode" json:"giftCardCode"` }
type OrderSummary ¶
type OrderSummary struct { Total TotalSummary `bson:"total" json:"total"` Tax TotalSummary `bson:"tax" json:"tax"` Net TotalSummary `bson:"net" json:"net"` Saving string `bson:"saving" json:"saving"` }
type Payment ¶
type Payment struct { Session checkout.CreateCheckoutSessionResponse `bson:"session" json:"session"` Environment string `bson:"environment" json:"environment"` Client string `bson:"client" json:"client"` Events []webhook.NotificationRequestItem `bson:"events" json:"events"` RedirectEvents []checkout.PaymentDetailsResponse `bson:"redirectEvents" json:"redirectEvents"` }
type Product ¶
type Product struct { ID primitive.ObjectID `bson:"_id" json:"id"` SKU string `bson:"sku" json:"sku"` Name string `bson:"name" json:"name"` Price CustomizablePrice `bson:"price" json:"price"` TaxClassStandard string `bson:"taxClassStandard" json:"taxClassStandard"` TaxClassTakeAway string `bson:"taxClassTakeAway" json:"taxClassTakeAway"` Categories []string `bson:"categories" json:"categories"` Images []Image `bson:"images" json:"images"` Options []string `bson:"options" json:"options"` Variations []ProductVariation `bson:"variations" json:"variations"` DisabledIn []string `bson:"disabledIn" json:"disabledIn"` OutOfStockIn []string `bson:"outOfStockIn" json:"outOfStockIn"` Description string `bson:"description" json:"description"` Allergens []string `bson:"allergens" json:"allergens"` IsGiftCard bool `bson:"isGiftCard" json:"isGiftCard"` IsStar bool `bson:"isStar" json:"isStar"` IsNew bool `bson:"isNew" json:"isNew"` CreatedAt time.Time `bson:"createdAt" json:"createdAt"` UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"` }
func (*Product) IsAvailableInStore ¶
type ProductCategory ¶
type ProductOption ¶
type ProductOption struct { ID primitive.ObjectID `bson:"_id" json:"id"` Name string `bson:"name" json:"name"` DisplayName string `bson:"displayName" json:"displayName"` Values []ProductOptionValue `bson:"values" json:"values"` CreatedAt time.Time `bson:"createdAt" json:"createdAt"` UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"` }
type ProductOptionValue ¶
type ProductOptionValue struct { Name string `bson:"name" json:"name"` DisplayName string `bson:"displayName" json:"displayName"` PrintName string `bson:"printName" json:"printName"` Image *Image `bson:"image" json:"image"` DisabledIn []string `bson:"disabledIn" json:"disabledIn"` OutOfStockIn []string `bson:"outOfStockIn" json:"outOfStockIn"` Allergens []string `bson:"allergens" json:"allergens"` Price *CustomizablePrice `bson:"price,omitempty" json:"price,omitempty"` }
type ProductVariation ¶
type ProductVariation struct { SKU string `bson:"sku" json:"sku"` Price CustomizablePrice `bson:"price" json:"price"` Options []ProductVariationOption `bson:"options" json:"options"` }
type ProductVariationOption ¶
type RefundRequest ¶
type Store ¶
type Store struct { ID primitive.ObjectID `bson:"_id" json:"id"` Email string `bson:"email" json:"email"` Telephone string `bson:"telephone" json:"telephone"` Name string `bson:"name" json:"name"` Key string `bson:"key" json:"key"` Address string `bson:"address" json:"address"` Owner string `bson:"owner" json:"owner"` BusinessRegistration string `bson:"businessRegistration" json:"businessRegistration"` TaxNumber string `bson:"taxNumber" json:"taxNumber"` MBW map[string]string `bson:"mbw" json:"mbw"` MBWAllowOnlyCities map[string][]string `bson:"mbwAllowOnlyCities" json:"mbwAllowOnlyCities,omitempty"` Slots []map[string]bool `bson:"slots" json:"slots"` // week starts with Sunday = index 0 Holidays []string `bson:"holidays" json:"holidays"` SpecialDays map[string]map[string]bool `bson:"specialDays,omitempty" json:"specialDays,omitempty"` CreatedAt time.Time `bson:"createdAt" json:"createdAt"` UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"` DeliverectIntegration *DeliverectIntegration `bson:"deliverectIntegration,omitempty" json:"deliverectIntegration,omitempty"` }
type Tax ¶
type Tax struct { ID primitive.ObjectID `bson:"_id" json:"id"` Name string `bson:"name" json:"name"` DisplayName string `bson:"displayName" json:"displayName"` Rate string `bson:"rate" json:"rate"` CreatedAt time.Time `bson:"createdAt" json:"createdAt"` UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"` }
type TotalSummary ¶
Click to show internal directories.
Click to hide internal directories.