-
Notifications
You must be signed in to change notification settings - Fork 0
/
sale.go
79 lines (55 loc) · 1.47 KB
/
sale.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/**
* Copyright 2014 @ z3q.net.
* name :
* author : jarryliu
* date : 2013-12-08 11:44
* description :
* history :
*/
package sale
import "go2o/src/core/domain/interface/valueobject"
type ISale interface {
GetAggregateRootId() int
// 创建产品
CreateItem(*ValueItem) IItem
// 根据产品编号获取货品
GetItem(int) IItem
// 删除货品
DeleteItem(int) error
// 创建商品
CreateGoodsByItem(IItem, *ValueGoods) IGoods
// 创建商品
CreateGoods(*ValueGoods) IGoods
// 根据产品编号获取商品
GetGoods(int) IGoods
// 根据产品SKU获取商品
GetGoodsBySku(itemId, sku int) IGoods
// 创建分类
CreateCategory(*ValueCategory) ICategory
// 获取分类
GetCategory(int) ICategory
// 获取所有分类
GetCategories() []ICategory
// 删除分类
DeleteCategory(int) error
// 获取所有的销售标签
GetAllSaleTags() []ISaleTag
// 初始化销售标签
InitSaleTags() error
// 获取销售标签
GetSaleTag(id int) ISaleTag
// 根据Code获取销售标签
GetSaleTagByCode(code string) ISaleTag
// 创建销售标签
CreateSaleTag(v *ValueSaleTag) ISaleTag
// 删除销售标签
DeleteSaleTag(id int) error
// 删除商品
DeleteGoods(int) error
// 获取指定的商品快照
GetGoodsSnapshot(id int) *GoodsSnapshot
// 根据Key获取商品快照
GetGoodsSnapshotByKey(key string) *GoodsSnapshot
// 获取指定数量已上架的商品
GetOnShelvesGoods(start, end int, sortBy string) []*valueobject.Goods
}