From 18c875e89ccb58455269c138b6b40d0aed1a3a39 Mon Sep 17 00:00:00 2001 From: Yared Yemane Date: Thu, 10 Sep 2026 14:01:20 +0300 Subject: [PATCH] Fix subscription plan creation for zero-priced packages. Allow price=0 by replacing required float validation with gte=0 so free plans no longer fail with a misleading required-field error. Co-authored-by: Cursor --- internal/web_server/handlers/subscriptions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/web_server/handlers/subscriptions.go b/internal/web_server/handlers/subscriptions.go index ab2af279..620ed605 100644 --- a/internal/web_server/handlers/subscriptions.go +++ b/internal/web_server/handlers/subscriptions.go @@ -23,7 +23,7 @@ type createPlanReq struct { Category string `json:"category" validate:"required,oneof=LEARN_ENGLISH IELTS DUOLINGO"` DurationValue int32 `json:"duration_value"` DurationUnit string `json:"duration_unit"` - Price float64 `json:"price" validate:"required,min=0"` + Price float64 `json:"price" validate:"gte=0"` Currency string `json:"currency" validate:"required"` IsLifetime bool `json:"is_lifetime"` IsActive *bool `json:"is_active"`