test
This commit is contained in:
@@ -16,8 +16,8 @@ type Rule struct {
|
||||
|
||||
type Voucher struct {
|
||||
Code string `json:"code"`
|
||||
Value int64 `json:"discount"`
|
||||
rules []*messages.VoucherRule `json:"rules"`
|
||||
Value int64 `json:"value"`
|
||||
rules string `json:"rules"`
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
@@ -42,7 +42,14 @@ func (s *Service) GetVoucher(code string) (*messages.AddVoucher, error) {
|
||||
return &messages.AddVoucher{
|
||||
Code: code,
|
||||
Value: v.Value,
|
||||
VoucherRules: v.rules,
|
||||
VoucherRules: []*messages.VoucherRule{
|
||||
{
|
||||
Condition: v.rules,
|
||||
Type: "",
|
||||
Description: "",
|
||||
Action: "",
|
||||
},
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user