Skip to content

Commit

Permalink
fix: removed DrivingLicense Unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoka-tech committed Feb 26, 2025
1 parent 14ca656 commit 96b222b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 15 deletions.
11 changes: 5 additions & 6 deletions internal/entities/driving_license.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ package entities
type DrivingLicense string

const (
DrivingLicenseB DrivingLicense = "B"
DrivingLicenseBE DrivingLicense = "BE"
DrivingLicenseC DrivingLicense = "C"
DrivingLicenseCE DrivingLicense = "CE"
DrivingLicenseUnknown DrivingLicense = "Unknown"
DrivingLicenseB DrivingLicense = "B"
DrivingLicenseBE DrivingLicense = "BE"
DrivingLicenseC DrivingLicense = "C"
DrivingLicenseCE DrivingLicense = "CE"
)

func ParseDrivingLicense(drivingLicense string) DrivingLicense {
Expand All @@ -21,6 +20,6 @@ func ParseDrivingLicense(drivingLicense string) DrivingLicense {
case string(DrivingLicenseCE):
return DrivingLicenseCE
default:
return DrivingLicenseUnknown
return DrivingLicenseB
}
}
9 changes: 4 additions & 5 deletions internal/server/http/entities/driving_license.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package entities
type DrivingLicense string // @Name DrivingLicense

const (
DrivingLicenseB DrivingLicense = "B"
DrivingLicenseBE DrivingLicense = "BE"
DrivingLicenseC DrivingLicense = "C"
DrivingLicenseCE DrivingLicense = "CE"
DrivingLicenseUnknown DrivingLicense = "Unknown"
DrivingLicenseB DrivingLicense = "B"
DrivingLicenseBE DrivingLicense = "BE"
DrivingLicenseC DrivingLicense = "C"
DrivingLicenseCE DrivingLicense = "CE"
)
4 changes: 2 additions & 2 deletions internal/service/domain/watering_plan/watering_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,11 @@ func (w *WateringPlanService) validateUserRoles(users []*entities.User) bool {
func (w *WateringPlanService) validateUserDrivingLicenses(users []*entities.User, transporter, trailer *entities.Vehicle) error {
var requiredLicenses []entities.DrivingLicense

if transporter != nil && transporter.DrivingLicense != entities.DrivingLicenseUnknown {
if transporter != nil {
requiredLicenses = append(requiredLicenses, transporter.DrivingLicense)
}

if trailer != nil && trailer.DrivingLicense != entities.DrivingLicenseUnknown {
if trailer != nil {
requiredLicenses = append(requiredLicenses, trailer.DrivingLicense)
}

Expand Down
1 change: 0 additions & 1 deletion pkg/client/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2295,7 +2295,6 @@ components:
- DrivingLicenseBE
- DrivingLicenseC
- DrivingLicenseCE
- DrivingLicenseUnknown
EvaluationValue:
example:
consumed_water: 1.4658129805029452
Expand Down
1 change: 0 additions & 1 deletion pkg/client/model_driving_license.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 96b222b

Please sign in to comment.