From 2ce45656d9df3cf93a949ba829b5709cbce8e2cc Mon Sep 17 00:00:00 2001 From: matst80 Date: Sat, 18 Oct 2025 14:42:52 +0200 Subject: [PATCH] test --- pkg/voucher/service.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pkg/voucher/service.go b/pkg/voucher/service.go index e4dc5f0..e5913c3 100644 --- a/pkg/voucher/service.go +++ b/pkg/voucher/service.go @@ -15,9 +15,9 @@ type Rule struct { } type Voucher struct { - Code string `json:"code"` - Value int64 `json:"discount"` - rules []*messages.VoucherRule `json:"rules"` + Code string `json:"code"` + Value int64 `json:"value"` + rules string `json:"rules"` } type Service struct { @@ -40,9 +40,16 @@ func (s *Service) GetVoucher(code string) (*messages.AddVoucher, error) { } return &messages.AddVoucher{ - Code: code, - Value: v.Value, - VoucherRules: v.rules, + Code: code, + Value: v.Value, + VoucherRules: []*messages.VoucherRule{ + { + Condition: v.rules, + Type: "", + Description: "", + Action: "", + }, + }, }, nil }