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