mirror of
https://shylinux.com/x/enterprise
synced 2025-04-25 17:18:06 +08:00
36 lines
981 B
Go
36 lines
981 B
Go
package gongyinglian
|
|
|
|
import (
|
|
"shylinux.com/x/ice"
|
|
kit "shylinux.com/x/toolkits"
|
|
|
|
"shylinux.com/x/enterprise/src/gongyinglian/model"
|
|
)
|
|
|
|
type expense struct {
|
|
Value
|
|
fields string `data:"expense_type,amount,name,info,from_user_uid,to_user_uid AS user_uid"`
|
|
create string `name:"create expense_type* amount* name info" role:"boss,worker"`
|
|
modify string `name:"modify amount* name info" role:"boss,worker"`
|
|
list string `name:"list store_uid uid auto" role:"boss,worker"`
|
|
}
|
|
|
|
func (s expense) Create(m *ice.Message, arg ...string) {
|
|
arg = kit.TransArgKeys(s.transPrice(m, arg...), model.EXPENSE_TYPE, model.TYPE)
|
|
s.Insert(m, kit.Simple(arg, model.FROM_USER_UID, m.Option(model.USER_UID), m.OptionSimple(model.STORE_UID))...)
|
|
}
|
|
|
|
func init() { ice.TeamCtxCmd(expense{}) }
|
|
|
|
type ExpenseType int
|
|
|
|
const (
|
|
ExpenseTerm ExpenseType = iota
|
|
)
|
|
|
|
var ExpenseTypeList = map[ExpenseType]string{
|
|
ExpenseTerm: "term",
|
|
}
|
|
|
|
func (s ExpenseType) String() string { return ExpenseTypeList[s] }
|