simpler rules
This commit is contained in:
@@ -17,7 +17,7 @@ type Rule struct {
|
||||
type Voucher struct {
|
||||
Code string `json:"code"`
|
||||
Value int64 `json:"value"`
|
||||
rules string `json:"rules"`
|
||||
Rules string `json:"rules"`
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
@@ -42,13 +42,8 @@ func (s *Service) GetVoucher(code string) (*messages.AddVoucher, error) {
|
||||
return &messages.AddVoucher{
|
||||
Code: code,
|
||||
Value: v.Value,
|
||||
VoucherRules: []*messages.VoucherRule{
|
||||
{
|
||||
Condition: v.rules,
|
||||
Type: "",
|
||||
Description: "",
|
||||
Action: "",
|
||||
},
|
||||
VoucherRules: []string{
|
||||
v.Rules,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
@@ -59,7 +54,7 @@ type State struct {
|
||||
|
||||
type StateFile struct {
|
||||
State State `json:"state"`
|
||||
Vercion int `json:"version"`
|
||||
Version int `json:"version"`
|
||||
}
|
||||
|
||||
func (sf *StateFile) GetVoucher(code string) (*Voucher, bool) {
|
||||
|
||||
Reference in New Issue
Block a user