Skip to content

Commit 5fb7c57

Browse files
committed
feat(checkout): allow zero total checkout
1 parent 969bb33 commit 5fb7c57

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/domain/checkout/validatecheckout.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ func (c *Checkout) Validate() error {
1212
if c.CustomerEmail == "" {
1313
return errors.New("CustomerEmail cannot be empty")
1414
}
15-
if c.TotalPrice <= 0 {
16-
return errors.New("total price cannot be less than or equal to zero")
15+
if c.TotalPrice < 0 {
16+
return errors.New("total price cannot be less than zero")
1717
}
1818
if c.Timestamp.IsZero() {
1919
return fmt.Errorf("timestamp cannot be zero")

0 commit comments

Comments
 (0)