Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: removed DrivingLicense Unknown #438

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.