chore(deps): bump protovalidate to v1.0.0

bump version v0.4.1 (`e097f827e65240ac9fd4b1158849a8fc`) to v1.0.0 (`52f32327d4b045a79293a6ad4e7e1236`)

refactor: endpoint from `github.com/bufbuild/protovalidate-go` to `buf.build/go/protovalidate`

chore(deps): bump other dependencies
This commit is contained in:
2025-09-29 20:33:31 +01:00
parent 1ef41aeb26
commit 85019cf428
12 changed files with 214 additions and 83 deletions

View File

@@ -18,7 +18,7 @@ package warehouse
import (
"context"
"github.com/bufbuild/protovalidate-go"
"buf.build/go/protovalidate"
"github.com/rs/zerolog/log"
"google.golang.org/protobuf/types/known/emptypb"
@@ -69,7 +69,7 @@ func NewWarehouseService(cfg *ServiceConfig, store StorageController) *Warehouse
// Initialise the service
return &WarehouseService{
store: store,
pbVal: pbVal,
pbVal: &pbVal,
}
}
@@ -83,7 +83,7 @@ func (svc WarehouseService) ServiceInfo(ctx context.Context, req *commonpb.Servi
func (svc WarehouseService) ViewProductStock(ctx context.Context, req *pb.ViewProductStockRequest) (*pb.ViewProductStockResponse, error) {
// Validate the request args
if err := svc.pbVal.Validate(req); err != nil {
if err := (*svc.pbVal).Validate(req); err != nil {
// Provide the validation error to the user.
return nil, errors.NewServiceError(errors.ErrCodeInvalidArgument, "invalid request: "+err.Error())
}
@@ -99,7 +99,7 @@ func (svc WarehouseService) ViewProductStock(ctx context.Context, req *pb.ViewPr
func (svc WarehouseService) ViewReservation(ctx context.Context, req *pb.ViewReservationRequest) (*pb.ViewReservationResponse, error) {
// Validate the request args
if err := svc.pbVal.Validate(req); err != nil {
if err := (*svc.pbVal).Validate(req); err != nil {
// Provide the validation error to the user.
return nil, errors.NewServiceError(errors.ErrCodeInvalidArgument, "invalid request: "+err.Error())
}