test
This commit is contained in:
@@ -16,8 +16,8 @@ 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 {
|
||||||
@@ -42,7 +42,14 @@ 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