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 ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateGroupRequest ¶ added in v1.0.12
type CreateGroupRequest struct {
Store string `json:"store"`
}
type Customer ¶ added in v1.0.9
type Customer struct {
ID primitive.ObjectID `bson:"_id" json:"id"`
CustomerRef string `bson:"customerRef" json:"customerRef"`
FirstName string `bson:"firstName" json:"firstName"`
LastName string `bson:"lastName" json:"lastName"`
AddressLine1 string `bson:"addressLine1" json:"addressLine1"`
AddressLine2 string `bson:"addressLine2" json:"addressLine2"`
Postcode string `bson:"postcode" json:"postcode"`
City string `bson:"city" json:"city"`
Telephone string `bson:"telephone" json:"telephone"`
Email string `bson:"email" json:"email"`
Boxes []int `bson:"boxes" json:"boxes"`
CreatedAt time.Time `bson:"createdAt" json:"createdAt"`
UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"`
}
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 ¶ added in v1.0.9
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 ¶ added in v1.0.9
type GroupDetails struct {
Group Group `json:"group"`
Orders []OrderDetails `json:"orders"`
}
type HttpErrorBody ¶ added in v1.0.5
type Order ¶ added in v1.0.8
type Order struct {
ID primitive.ObjectID `bson:"_id" json:"id"`
OrderID string `bson:"orderId" json:"orderId"`
OrderNumber string `bson:"orderNumber" json:"orderNumber"`
InvoiceNumber string `bson:"invoiceNumber" json:"invoiceNumber"`
ValidAddress bool `bson:"validAddress" json:"validAddress"`
Address string `bson:"address" json:"address"`
AddressLine2 string `bson:"addressLine2" json:"addressLine2"`
Email string `bson:"email" json:"email"`
Telephone string `bson:"telephone" json:"telephone"`
CustomerNote string `bson:"customerNote" json:"customerNote"`
DeliveryDate string `bson:"deliveryDate" json:"deliveryDate"`
DeliveryTime string `bson:"deliveryTime" json:"deliveryTime"`
ShippingMethod OrderShippingMethod `bson:"shippingMethod" json:"shippingMethod"`
Customer primitive.ObjectID `bson:"customer" json:"customer"`
Status OrderStatus `bson:"status" json:"status"`
Secret string `bson:"secret" json:"secret"`
Items []OrderItem `bson:"items" json:"items"`
Net string `bson:"net" json:"net"`
Tax string `bson:"tax" json:"tax"`
Total string `bson:"total" json:"total"`
PaidTotal string `bson:"paidTotal" json:"paidTotal"`
CouponCode string `bson:"couponCode" json:"couponCode"`
AppliedCouponNet string `bson:"appliedCouponNet" json:"appliedCouponNet"`
AppliedCouponTax string `bson:"appliedCouponTax" json:"appliedCouponTax"`
AppliedCouponTotal string `bson:"appliedCouponTotal" json:"appliedCouponTotal"`
Tip string `bson:"tip" json:"tip"`
Printed bool `bson:"printed" json:"printed"`
LocalPickupNotified bool `bson:"localPickupNotified" json:"localPickupNotified"`
ReadyIn string `bson:"readyIn" json:"readyIn"`
Store primitive.ObjectID `bson:"store" json:"store"`
CompanyKey string `bson:"companyKey" json:"companyKey"`
PaymentEvents []interface{} `bson:"paymentEvents" json:"paymentEvents"`
LastSessionId string `bson:"lastSessionId" json:"lastSessionId"` // for corporate page
NewBoxes int `bson:"newBoxes" json:"newBoxes"`
ReturnBoxes int `bson:"returnBoxes" json:"returnBoxes"`
CreatedAt time.Time `bson:"createdAt" json:"createdAt"`
UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"`
}
type OrderDetails ¶ added in v1.0.9
type OrderItem ¶ added in v1.0.8
type OrderItem struct {
Name string `bson:"name" json:"name"`
Quantity int `bson:"quantity" json:"quantity"`
SKU string `bson:"sku" json:"sku"`
Categories []string `bson:"categories" json:"categories"`
Extra []OrderItemExtra `bson:"extra" json:"extra"`
Net string `bson:"net" json:"net"`
Tax string `bson:"tax" json:"tax"`
TaxClass string `bson:"taxClass" json:"taxClass"`
TaxRate string `bson:"taxRate" json:"taxRate"`
Total string `bson:"total" json:"total"`
}
type OrderItemExtra ¶ added in v1.0.8
type OrderShippingMethod ¶ added in v1.0.8
type OrderShippingMethod string
const ( OrderShippingMethodFreeShipping OrderShippingMethod = "free_shipping" OrderShippingMethodLocalPickup OrderShippingMethod = "local_pickup" )
type OrderStatus ¶ added in v1.0.8
type OrderStatus string
const ( OrderStatusPending OrderStatus = "PENDING" OrderStatusNew OrderStatus = "NEW" OrderStatusNotPossible OrderStatus = "NOT_POSSIBLE" OrderStatusCancelled OrderStatus = "CANCELLED" OrderStatusAddedToGroup OrderStatus = "ADDED_TO_GROUP" OrderStatusGroupFinalized OrderStatus = "GROUP_FINALIZED" OrderStatusDelivered OrderStatus = "DELIVERED" )
type Store ¶ added in v1.0.1
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 ¶ added in v1.0.1
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 ¶ added in v1.0.3
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"`
}
Click to show internal directories.
Click to hide internal directories.