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 }