Files
3ybactuk-marketplace-go-ser…/comments/internal/domain/model/comment.go
2025-07-26 17:31:38 +03:00

23 lines
393 B
Go

package model
import (
"fmt"
"time"
)
type Comment struct {
ID int64 `validate:"gt=0"`
UserID int64 `validate:"gt=0"`
SKU int64 `validate:"gt=0"`
CreatedAt time.Time
Text string `validate:"lte=255,gt=0"`
}
func (c *Comment) Validate() error {
if err := validate.Struct(c); err != nil {
return fmt.Errorf("invalid requested values: %w", err)
}
return nil
}