Documentation ¶
Index ¶
- Constants
- func NewArticleDistinctFiltersFromArgs(args *map[string]interface{}, omitted ...string) interface{}
- func NewArticleFiltersFromArgs(args *map[string]interface{}) bson.M
- type DistincItem
- type MaxMinItem
- type ModelArticle
- func (model *ModelArticle) AddStock(article primitive.ObjectID, size string) (*defs.Stock, error)
- func (model *ModelArticle) Create(name string, description string, price float64, images []defs.File, ...) (*defs.Article, error)
- func (model *ModelArticle) DeleteArticle(id primitive.ObjectID) error
- func (model *ModelArticle) DistincUsingFilters(path interface{}, filter ...interface{}) ([]DistincItem, error)
- func (model *ModelArticle) FindById(id primitive.ObjectID) (interface{}, error)
- func (model *ModelArticle) FindOne(args *map[string]interface{}, opts ...*options.FindOneOptions) (interface{}, error)
- func (model *ModelArticle) FindSlice(args *map[string]interface{}) (result []defs.Article, meta oprs.SliceMetadata, err error)
- func (model *ModelArticle) FindStockById(stockId primitive.ObjectID) (*defs.StockArticle, error)
- func (model *ModelArticle) FindStockBySize(stockSize string) (*defs.StockArticle, error)
- func (model *ModelArticle) GetCategories(args *map[string]interface{}) ([]DistincItem, error)
- func (model *ModelArticle) GetCount() (int64, error)
- func (model *ModelArticle) GetPriceRange(args *map[string]interface{}) (*MaxMinItem, error)
- func (model *ModelArticle) GetSizes(args *map[string]interface{}) ([]DistincItem, error)
- func (model *ModelArticle) Sync(article *defs.Article) error
- func (model *ModelArticle) UpdateArticle(id primitive.ObjectID, name string, description string, price float64, ...) error
- func (model *ModelArticle) UploadImage(filename string, source io.Reader) (primitive.ObjectID, error)
- type ModelOrder
- func (model *ModelOrder) Cancel(id primitive.ObjectID) (*defs.Order, error)
- func (model *ModelOrder) ConfirmReceived(id primitive.ObjectID) (*defs.Order, error)
- func (model *ModelOrder) Create(stock primitive.ObjectID, user primitive.ObjectID, notes string) (*defs.Order, error)
- func (model *ModelOrder) FindById(id primitive.ObjectID) (interface{}, error)
- func (model *ModelOrder) FindOne(args *map[string]interface{}) (interface{}, error)
- func (model *ModelOrder) FindSlice(args *map[string]interface{}) ([]interface{}, *oprs.FindSliceMetadata, error)
- func (model *ModelOrder) GetCount() (int64, error)
- func (model *ModelOrder) GetState(id primitive.ObjectID) (int8, error)
- func (model *ModelOrder) Prepare(id primitive.ObjectID) (*defs.Order, error)
- func (model *ModelOrder) Purchase(id primitive.ObjectID, paymentMethod int8, purchaseRef string) (*defs.Order, error)
- func (model *ModelOrder) Ship(id primitive.ObjectID, trackingRef string) (*defs.Order, error)
- func (model *ModelOrder) Sync(order *defs.Order) error
- func (model *ModelOrder) UpdateState(id primitive.ObjectID, state int8) (*defs.Order, error)
- type ModelUser
Constants ¶
View Source
const ( ARTICLE_STOCK_SORTING_POPULARITY int = 1 ARTICLE_STOCK_SORTING_PURCHASES int = 2 ARTICLE_STOCK_SORTING_RECENTS int = 3 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DistincItem ¶
type MaxMinItem ¶
type ModelArticle ¶
type ModelArticle struct {
// contains filtered or unexported fields
}
func NewModelArticle ¶
func NewModelArticle(db *mongo.Database) *ModelArticle
func (*ModelArticle) DeleteArticle ¶
func (model *ModelArticle) DeleteArticle(id primitive.ObjectID) error
func (*ModelArticle) DistincUsingFilters ¶
func (model *ModelArticle) DistincUsingFilters(path interface{}, filter ...interface{}) ([]DistincItem, error)
func (*ModelArticle) FindById ¶
func (model *ModelArticle) FindById(id primitive.ObjectID) (interface{}, error)
func (*ModelArticle) FindOne ¶
func (model *ModelArticle) FindOne(args *map[string]interface{}, opts ...*options.FindOneOptions) (interface{}, error)
func (*ModelArticle) FindSlice ¶
func (model *ModelArticle) FindSlice(args *map[string]interface{}) ( result []defs.Article, meta oprs.SliceMetadata, err error, )
func (*ModelArticle) FindStockById ¶
func (model *ModelArticle) FindStockById(stockId primitive.ObjectID) (*defs.StockArticle, error)
func (*ModelArticle) FindStockBySize ¶
func (model *ModelArticle) FindStockBySize(stockSize string) (*defs.StockArticle, error)
func (*ModelArticle) GetCategories ¶
func (model *ModelArticle) GetCategories(args *map[string]interface{}) ([]DistincItem, error)
func (*ModelArticle) GetCount ¶
func (model *ModelArticle) GetCount() (int64, error)
func (*ModelArticle) GetPriceRange ¶
func (model *ModelArticle) GetPriceRange(args *map[string]interface{}) (*MaxMinItem, error)
func (*ModelArticle) GetSizes ¶
func (model *ModelArticle) GetSizes(args *map[string]interface{}) ([]DistincItem, error)
func (*ModelArticle) UpdateArticle ¶
func (*ModelArticle) UploadImage ¶
type ModelOrder ¶
type ModelOrder struct {
// contains filtered or unexported fields
}
ModelOrder asd
func NewModelOrder ¶
func NewModelOrder(db *mongo.Database, modelArticle *ModelArticle, modelUser *ModelUser) *ModelOrder
NewOrderModel
func (*ModelOrder) ConfirmReceived ¶
func (*ModelOrder) Create ¶
func (model *ModelOrder) Create(stock primitive.ObjectID, user primitive.ObjectID, notes string) (*defs.Order, error)
Create
func (*ModelOrder) FindById ¶
func (model *ModelOrder) FindById(id primitive.ObjectID) (interface{}, error)
func (*ModelOrder) FindOne ¶
func (model *ModelOrder) FindOne(args *map[string]interface{}) (interface{}, error)
func (*ModelOrder) FindSlice ¶
func (model *ModelOrder) FindSlice(args *map[string]interface{}) ([]interface{}, *oprs.FindSliceMetadata, error)
func (*ModelOrder) GetCount ¶
func (model *ModelOrder) GetCount() (int64, error)
func (*ModelOrder) GetState ¶
func (model *ModelOrder) GetState(id primitive.ObjectID) (int8, error)
func (*ModelOrder) UpdateState ¶
Click to show internal directories.
Click to hide internal directories.