admin

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: Unlicense Imports: 2 Imported by: 5

Documentation

Index

Constants

View Source
const (
	CollectionCustomer     = "customers"
	CollectionGlobalConfig = "globalconfigs"
	CollectionGroup        = "groups"
	CollectionIncrement    = "increments"
	CollectionOrder        = "orders"
	CollectionProduct      = "products"
	CollectionStore        = "stores"
	CollectionTax          = "taxes"
	CollectionUser         = "users"
)

Variables

View Source
var (
	GroupObjectIDs = []string{
		"orders", "driver", "store",
	}
)

Functions

This section is empty.

Types

type Coupon

type Coupon struct {
	ID     int    `json:"id"`
	Code   string `json:"code"`
	Amount string `json:"amount"`
}

type CreateGroupRequest

type CreateGroupRequest struct {
	Store string `json:"store"`
}

type Device

type Device struct {
	Name     string `bson:"name" json:"name"`
	DeviceID string `bson:"deviceId" json:"deviceId"`
}

type GetRevenueRequest

type GetRevenueRequest struct {
	From    time.Time          `json:"from"`
	To      time.Time          `json:"to"`
	StoreID primitive.ObjectID `json:"storeId"`
}

type GlobalConfig

type GlobalConfig struct {
	ID                           primitive.ObjectID `bson:"_id" json:"id"`
	ProductAttributeOutOfStockIn int                `bson:"productAttributeOutOfStockInId" json:"productAttributeOutOfStockInId"`
	ProductAttributePfandId      int                `bson:"productAttributePfandId" json:"productAttributePfandId"`
	PusherAPIKey                 string             `json:"pusherApiKey"` // TODO: before provide PATCH method, add this to DB!!!
	CreatedAt                    time.Time          `bson:"createdAt" json:"createdAt"`
	UpdatedAt                    time.Time          `bson:"updatedAt" json:"updatedAt"`
}

type Group

type Group struct {
	ID         primitive.ObjectID   `bson:"_id" json:"id"`
	Orders     []primitive.ObjectID `bson:"orders" json:"orders"`
	RouteOrder []int                `bson:"routeOrder" json:"routeOrder"`
	Number     string               `bson:"number" json:"number"`
	Finalized  bool                 `bson:"finalized" json:"finalized"`
	Delivered  bool                 `bson:"delivered" json:"delivered"`
	Driver     primitive.ObjectID   `bson:"driver" json:"driver"`
	DriverName string               `bson:"driverName" json:"driverName"`
	Store      primitive.ObjectID   `bson:"store" json:"store"`
	CreatedAt  time.Time            `bson:"createdAt" json:"createdAt"`
	UpdatedAt  time.Time            `bson:"updatedAt" json:"updatedAt"`
}

type GroupDetails

type GroupDetails struct {
	Group  Group          `json:"group"`
	Orders []OrderDetails `json:"orders"`
}

type HttpErrorBody

type HttpErrorBody struct {
	Message     string `json:"message"`
	RequestID   string `json:"requestId"`
	RequestTime string `json:"requestTime"`
	Method      string `json:"method"`
	Path        string `json:"path"`
}

type Increment

type Increment struct {
	ID        primitive.ObjectID `bson:"_id"`
	Key       string             `bson:"key"`
	Value     int64              `bson:"value"`
	CreatedAt time.Time          `bson:"createdAt"`
	UpdatedAt time.Time          `bson:"updatedAt"`
}

type PaymentDropInRequest

type PaymentDropInRequest struct {
	ReturnURL string `json:"returnUrl"`
}

type PaymentDropInResponse

type PaymentDropInResponse struct {
	ID          string `json:"id"`
	SessionData string `json:"sessionData"`
}

type Product

type Product struct {
	ID           primitive.ObjectID `bson:"_id" json:"id"`
	WPID         int                `bson:"id" json:"wpId"` // it's ok in patch request because we won't change this
	Name         string             `bson:"name" json:"name"`
	Permalink    string             `bson:"permalink" json:"permalink"`
	Type         ProductType        `bson:"type" json:"type"`
	SKU          string             `bson:"sku" json:"sku"`
	Price        string             `bson:"price" json:"price"`
	RegularPrice string             `bson:"regularPrice" json:"regularPrice"`
	SalePrice    string             `bson:"salePrice" json:"salePrice"`
	TaxClass     string             `bson:"taxClass" json:"taxClass"`
	Categories   []string           `bson:"categories" json:"categories"`
	Images       []string           `bson:"images" json:"images"`
	Attributes   []ProductAttribute `bson:"attributes" json:"attributes"`
	Variations   []ProductVariation `bson:"variations" json:"variations"`
	OutOfStockIn []string           `bson:"outOfStockIn" json:"outOfStockIn"`
	Pfand        string             `bson:"pfand" json:"pfand"`
	CreatedAt    time.Time          `bson:"createdAt" json:"createdAt"`
	UpdatedAt    time.Time          `bson:"updatedAt" json:"updatedAt"`
}

type ProductAttribute

type ProductAttribute struct {
	WPID      int      `bson:"id" json:"wpId"` // it's ok in patch request because we won't change this
	Name      string   `bson:"name" json:"name"`
	Position  int      `bson:"position" json:"position"`
	Variation bool     `bson:"variation" json:"variation"`
	Visible   bool     `bson:"visible" json:"visible"`
	Options   []string `bson:"options" json:"options"`
}

type ProductType

type ProductType string
const (
	ProductTypeSimple   ProductType = "simple"
	ProductTypeVariable ProductType = "variable"
)

type ProductVariation

type ProductVariation struct {
	WPID         int                         `bson:"id" json:"wpId"` // it's ok in patch request because we won't change this
	Price        string                      `bson:"price" json:"price"`
	RegularPrice string                      `bson:"regularPrice" json:"regularPrice"`
	SalePrice    string                      `bson:"salePrice" json:"salePrice"`
	Attributes   []ProductVariationAttribute `bson:"attributes" json:"attributes"`
}

type ProductVariationAttribute

type ProductVariationAttribute struct {
	WPID   int    `bson:"id" json:"wpId"` // it's ok in patch request because we won't change this
	Name   string `bson:"name" json:"name"`
	Option string `bson:"option" json:"option"`
}

type PusherGroupEvent

type PusherGroupEvent struct {
	StoreID string `json:"storeId"`
}

type PusherOrderEvent

type PusherOrderEvent struct {
	StoreID string `json:"storeId"`
}

type PusherOrderPaymentEvent

type PusherOrderPaymentEvent struct {
	OrderID string `json:"orderId"`
}

type Revenue

type Revenue struct {
	Request GetRevenueRequest `json:"request"`
	Items   []RevenueItem     `json:"items"`
}

type RevenueItem

type RevenueItem struct {
	Text  string               `json:"type"`
	Total primitive.Decimal128 `json:"total"`
}

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"`
	Address       string             `bson:"address" json:"address"`
	Company       string             `bson:"company" json:"company"`
	Owner         string             `bson:"owner" json:"owner"`
	Register      string             `bson:"register" json:"register"`
	Tax           string             `bson:"tax" json:"tax"`
	Configuration StoreConfiguration `bson:"configuration" json:"configuration"`
	Drivers       []string           `bson:"drivers" json:"drivers"`
	Devices       []Device           `bson:"devices" json:"devices"`
	CreatedAt     time.Time          `bson:"createdAt" json:"createdAt"`
	UpdatedAt     time.Time          `bson:"updatedAt" json:"updatedAt"`
}

type StoreConfiguration

type StoreConfiguration struct {
	EnablePrinterAddress      bool   `bson:"enablePrinterAddress" json:"enablePrinterAddress"`
	EnablePrinterInternal     bool   `bson:"enablePrinterInternal" json:"enablePrinterInternal"`
	EnablePrinterPositions    bool   `bson:"enablePrinterPositions" json:"enablePrinterPositions"`
	POSID                     string `bson:"posId" json:"posId"`
	EnableAutomaticPosPayment bool   `bson:"enableAutomaticPosPayment" json:"enableAutomaticPosPayment"`
	WPStoreKey                string `bson:"wpStoreKey" json:"wpStoreKey"`
}

type Tax

type Tax struct {
	ID        primitive.ObjectID `bson:"_id" json:"id"`
	WPID      int                `bson:"id" json:"wpId"`
	Rate      string             `bson:"rate" json:"rate"`
	Name      string             `bson:"name" json:"name"`
	TaxClass  string             `bson:"class" json:"taxClass"` // it's ok to have different names here because we don't provide PATCH request for this entity.
	CreatedAt time.Time          `bson:"createdAt" json:"createdAt"`
	UpdatedAt time.Time          `bson:"updatedAt" json:"updatedAt"`
}

Jump to

Keyboard shortcuts

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