simpler rules
Some checks failed
Build and Publish / Metadata (push) Successful in 9s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 1m6s
Build and Publish / BuildAndDeployArm64 (push) Has been cancelled

This commit is contained in:
matst80
2025-10-18 15:21:11 +02:00
parent d58409e3fc
commit b7f0990269
4 changed files with 114 additions and 209 deletions

View File

@@ -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) {